MinGW linking question, lib .a files

This isn't really about the language itself, more about the compiler, but can anyone explain the difference between trying to link libraries
... -lopengl32 ...
and
.. C:\MinGW\lib\libopengl32.a ... (I know this path exists)
input into g++
The former worked, program compiled, the latter no so much. Perhaps I'm completely misunderstanding what the compiler is trying to with these two links. (I got things working fine on Ubuntu (thank you apt-get), but Windows makes it harder, I'm using CodeBlocks IDE on Windows.) I feel like if I correctly learn what the compiler is trying to do, installing/linking libraries wouldn't be so hard.
Last edited on
All I know is that the order you specify things on the commandline is important. Other than that, I am just as lost as you are and have yet to find easy to understand documentation on this.

Could you provide minimal test cases with full command lines?
Oh, well... I had been trying a bunch of other stuff since I posted this. If I can duplicate the exact error I'll edit this post (or bump if I end up not having enough time tonight), with --verbose turned on. [I might have been typing stuff into the wrong parts of CodeBlocks at first before I revised it.]

Another misunderstanding I had: I thought it was optional, but apparently having the "lib" before a [lib]name_of_library.a library file is required.
When I had the "glfw3dll" library linked, it wasn't finding it when the filename was "glfw3dll.a", but it found the file when I renamed it "libglfw3dll.a". So at least I've learned something.. =)
Last edited on
Topic archived. No new replies allowed.