Madour / LDtkLoader

A C++11 loader for levels and tile maps created with LDtk (Level Designer ToolKit)
Other
102 stars 25 forks source link

Compilation issues with g++ #44

Closed MatthewRoxby closed 5 months ago

MatthewRoxby commented 5 months ago

Hello! I'm trying to use this library for a Raylib project of mine, but I can't seem to get it to link properly when compiling with g++. I'd greatly appreciate any help!

My current build command:

g++ -g -I./include -L./lib ./src/*.cpp -o ./bin/cppGame.exe -lraylib -lLDtkLoader -lopengl32 -lgdi32 -lwinmm

And the error I'm getting is:

C:/ProgramData/mingw64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lLDtkLoader.lib: No such file or directory
collect2.exe: error: ld returned 1 exit status

Build finished with error(s).

It could possibly be that g++ doesn't like .lib files, I think I heard that somewhere.

MatthewRoxby commented 5 months ago

Okay, I managed to fix it! Just had to reconfigure cmake to use g++ instead of VS build tools to get a .a file instead of a .lib. I'll close this issue now.