I’m building my application using the 64 bit MinGW, “x86_64-posix-seh-rev1, Built by MinGW-W64 project” to be precise.
At first I downloaded the 64 bit MinGW prebuilt from the website, but it didn’t link, undefined reference to basic stuff like glfwInit and half a dozen others.
Then I downloaded the source, configured it up for my MinGW and built it. It built without problems, even the example programs compiled and linked up, I can run them, they work fine.
I checked into the generated .a file (which is different from the prebuilt one from the website, larger by around 12k), and surely enough, the compiler left its mark in it: GCC: (x86_64-posix-seh-rev1, Built by MinGW-W64 project)
But when I try to link against this version, I get the same undefined references. The -l argument works, because it doesn’t complain about not finding the library, I removed the other .a files from the lib directory because I’ve read that it might confuse the glfw3.dll and the libglfw3.a or something.
My linker line is:
g++ -Ld:\Programs\Chipmunk-7.0.2\Build\src\ -Ld:\Programs\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\lib\ -lchipmunk -lglfw3 -lopengl32 -lgdi32 build/graphics/GlWindow.o build/app/main.o -o build/gurgula.exe
There must be something wrong with my side, because as I said, the example programs build fine. But I can’t get the proper parameterization out of the jungle of make files in that cmake-generated mess.