boku-ilen / geodot-plugin

Godot plugin for loading geospatial data
GNU General Public License v3.0
108 stars 18 forks source link

Building on windows with docker: cannot find -lgodot-cpp.windows.template_debug.x86_64 #78

Closed apwebber closed 1 year ago

apwebber commented 1 year ago

Hi,

Just trying to follow the instructions for building on windows, it's all good until the final build command. I get this output:

C:\Users\Alex\Dropbox\Random Crap\Godot\geodot-plugin>docker run --name mingw-builder gdal-mingw:latest scons: Reading SConscript files ... scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... /usr/bin/x86_64-w64-mingw32-g++ -o GeoRaster.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global GeoRaster.cpp /usr/bin/x86_64-w64-mingw32-g++ -o RasterTileExtractor.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global RasterTileExtractor.cpp ar rc build/libRasterTileExtractor.a GeoRaster.o RasterTileExtractor.o ranlib build/libRasterTileExtractor.a scons: done building targets. scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... /usr/bin/x86_64-w64-mingw32-g++ -o Feature.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global Feature.cpp /usr/bin/x86_64-w64-mingw32-g++ -o LineFeature.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global LineFeature.cpp /usr/bin/x86_64-w64-mingw32-g++ -o NativeDataset.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global NativeDataset.cpp /usr/bin/x86_64-w64-mingw32-g++ -o NativeLayer.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global NativeLayer.cpp /usr/bin/x86_64-w64-mingw32-g++ -o PointFeature.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global PointFeature.cpp /usr/bin/x86_64-w64-mingw32-g++ -o PolygonFeature.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global PolygonFeature.cpp /usr/bin/x86_64-w64-mingw32-g++ -o VectorExtractor.o -c -std=c++17 -fPIC -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -I/geodot/src/global VectorExtractor.cpp ar rc build/libVectorExtractor.a Feature.o LineFeature.o NativeDataset.o NativeLayer.o PointFeature.o PolygonFeature.o VectorExtractor.o ranlib build/libVectorExtractor.a scons: done building targets. scons: done reading SConscript files. scons: Building targets ... x86_64-w64-mingw32-g++ -o src/geodata.os -c -std=c++17 -fPIC -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Isrc/raster-tile-extractor -Isrc/vector-extractor -Isrc -Isrc/global src/geodata.cpp x86_64-w64-mingw32-g++ -o src/geofeatures.os -c -std=c++17 -fPIC -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Isrc/raster-tile-extractor -Isrc/vector-extractor -Isrc -Isrc/global src/geofeatures.cpp x86_64-w64-mingw32-g++ -o src/geoimage.os -c -std=c++17 -fPIC -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Isrc/raster-tile-extractor -Isrc/vector-extractor -Isrc -Isrc/global src/geoimage.cpp x86_64-w64-mingw32-g++ -o src/geotransform.os -c -std=c++17 -fPIC -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Isrc/raster-tile-extractor -Isrc/vector-extractor -Isrc -Isrc/global src/geotransform.cpp x86_64-w64-mingw32-g++ -o src/register_types.os -c -std=c++17 -fPIC -DDEBUG_ENABLED -DDEBUG_METHODS_ENABLED -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I. -Igodot-cpp/gdextension -Igodot-cpp/include -Igodot-cpp/gen/include -Isrc/raster-tile-extractor -Isrc/vector-extractor -Isrc -Isrc/global src/register_types.cpp x86_64-w64-mingw32-g++ -o demo/addons/geodot/win64/libgeodot.dll -static-libgcc -static-libstdc++ -static -shared src/geodata.os src/geofeatures.os src/geoimage.os src/geotransform.os src/register_types.os -Lgodot-cpp/bin -Lsrc/raster-tile-extractor/build -Lsrc/vector-extractor/build -L/usr/x86_64-w64-mingw32/sys-root/mingw/lib -lgodot-cpp.windows.template_debug.x86_64 -lRasterTileExtractor -lVectorExtractor -lgdal.dll /usr/lib/gcc/x86_64-w64-mingw32/13.1.1/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lgodot-cpp.windows.template_debug.x86_64: No such file or directory collect2: error: ld returned 1 exit status scons: *** [demo/addons/geodot/win64/libgeodot.dll] Error 1 scons: building terminated because of errors.

Any ideas what's wrong here? Thanks!

kb173 commented 1 year ago

Hi! This error occurs when godot-cpp wasn't built before building Geodot, the library being linked to are the godot-cpp bindings. Did you run cd godot-cpp; scons platform=windows generate_bindings=yes before building the Docker container? If so, can you let me know what the contents of geodot-plugin/godot-cpp/bin/ are?

apwebber commented 1 year ago

Hi, yep I did run that command, there is one file in that folder libgodot-cpp.windows.template_debug.x86_64.lib

kb173 commented 1 year ago

Ah, we get libgodot-cpp.windows.template_debug.x86_64.a rather than .lib on our build container. I think this means you ran cd godot-cpp; scons platform=windows generate_bindings=yes on a standard Windows command line, right? We've never tested that, seems like it doesn't work, maybe since that then uses MSVC rather than MinGW? Not sure how to get it to use MinGW; maybe you could try running that step on WSL? I'll add a note on that to the README once we've figured it out, thanks for testing!

apwebber commented 1 year ago

That was it! Yes I see now the instructions do say to run on WSL. The other thing I had to do was install scons and mingw in WSL.

kb173 commented 1 year ago

Great! I added the SCons and MinGW installation step to the README and tried emphasizing the need for WSL more. Thanks!