heppocogne / godot-svgsprite

GDNative addon for dynamic svg rendering
MIT License
7 stars 1 forks source link

Impossible to build godot-svgsprite library #6

Open stebulba opened 1 year ago

stebulba commented 1 year ago

I am on Ubuntu 22.04

command: scons platform=linux target_name=libgodot-svgsprite target=release
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o cpp/src/svgsprite.os -c -fPIC -g -O3 -std=c++17 -fPIC -Icpp/godot-cpp/godot-headers -Icpp/godot-cpp/include -Icpp/godot-cpp/include/core -Icpp/godot-cpp/include/gen -Icpp/src -Icpp/lunasvg/include -Icpp/lunasvg/3rdparty/plutovg -Icpp/lunasvg/3rdparty/software cpp/src/svgsprite.cpp
cpp/src/svgsprite.cpp: In member function 'void godot::SVGSprite::set_svg_file(godot::String)':
cpp/src/svgsprite.cpp:187:30: error: ambiguous overload for 'operator=' (operand types are 'godot::Ref<godot::Texture>' and 'std::nullptr_t')
  187 |         _ref_prerasterized = nullptr;
      |                              ^~~~~~~
In file included from cpp/godot-cpp/include/core/Godot.hpp:42,
                 from cpp/src/svgsprite.h:4,
                 from cpp/src/svgsprite.cpp:1:
cpp/godot-cpp/include/core/Ref.hpp:109:14: note: candidate: 'void godot::Ref<T>::operator=(const godot::Ref<T>&) [with T = godot::Texture]'
  109 |         void operator=(const Ref &p_from) {
      |              ^~~~~~~~
cpp/godot-cpp/include/core/Ref.hpp:126:14: note: candidate: 'void godot::Ref<T>::operator=(const godot::Variant&) [with T = godot::Texture]'
  126 |         void operator=(const Variant &p_variant) {
      |              ^~~~~~~~
scons: *** [cpp/src/svgsprite.os] Error 1
scons: building terminated because of errors.
heppocogne commented 1 year ago

I'm sorry but I can't test build on linux environment. What happen if you change _ref_prerasterized = nullptr; to _ref_prerasterized = Ref<ImageTexture>();?

stebulba commented 1 year ago

I'm sorry but I can't test build on linux environment. What happen if you change _ref_prerasterized = nullptr; to _ref_prerasterized = Ref<ImageTexture>();?

Yes that work. But I got a new error. I have no time to figure that for now.

godot-svgsprite$ scons platform=linux target_name=libgodot-svgsprite target=release
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o bin/x11/libgodot-svgsprite-release.so -shared cpp/src/rawsvg_loader.os cpp/src/svgsprite.os cpp/src/gdlibrary.os -Lcpp/godot-cpp/bin -Lcpp/lunasvg_build -lgodot-cpp.linux.release.64 -llunasvg.lib
/bin/ld: cannot find -llunasvg.lib: No such file or directory
collect2: error: ld returned 1 exit status
scons: *** [bin/x11/libgodot-svgsprite-release.so] Error 1
scons: building terminated because of errors.