you-win / spout-gd

Spout for Godot 4
Mozilla Public License 2.0
36 stars 7 forks source link

scons unable to find spout library during build.sh #15

Open oakheartsoftware opened 1 month ago

oakheartsoftware commented 1 month ago

When scons attempts to build spout-gd I get the following error: `g++ -shared -o out\spout_gd.windows.template_debug.dll src\register_types.o src\spout_gd.o $( -Lgodot-cpp\bin $) -lgodot-cpp.windows.template_de bug.x86_64 -lSpout2\Binaries\x64\SpoutLibrary.lib -Wl,--out-implib,out\libspout_gd.windows.template_debug.a

C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSpout2\Binaries\x64\SpoutLibrary.lib: No such file or directory collect2.exe: error: ld returned 1 exit status`

I verified that SpoutLibrary.lib existed in the correct place but scons still was unable to find it.

My solution I found this description of the scons LIBS parameter being relative to the LIBSPATH parameter, which isn't currently set in the SConstruct file. This is the quote,

"You link libraries with a program by specifying the libraries in the $LIBS construction variable, and by specifying the directory in which the library will be found in the $LIBPATH construction variable"

So I changed the spout-gd SConstruct file to specify the LIBPATH variable (and also took out the .lib file suffix as the documentation states it is inferred) env.Append(CPPPATH=["src", "."], LIBS=["Spout2\\Binaries\\x64\\SpoutLibrary"], LIBPATH='.')

Running scons again for spout-gd then completed successfully.