0

I'm working on an OpenGL project recently and decided to move to 64 bit, so i changed the compiler to g++ 4.9.2 which supports 64bit. I changed the other libraries to 64bit too, but only the system provided libs, Glu32 and OpenGL32, can't be found by the compiler. I installed the Windows SDK which provides the libraries in 64bit. Strangely these do also have the 32 suffix... whatever, probably for easier porting.

I've declared the Path C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64 in several ways as an additional library directory, relative, absolute and with wildcards (%ProgramFiles%/...) but none of them seemed to fit for the linker:

c:/Program Files (x86)/mingw-w64/i686-4.9.2-win32-sjlj-rt_v3-rev1/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lOpenGL32.Lib
c:/Program Files (x86)/mingw-w64/i686-4.9.2-win32-sjlj-rt_v3-rev1/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lGlU32.Lib

Compile instruction

g++ -m64 -o dist/Debug/MinGW_64-Windows/engine >>imagine some object files in here<< -Lresource/Glew/lib/Release/x64 -Lresource/SDL/x86_64-w64-mingw32/lib -L\"C\:\Program\ Files\Microsoft\ SDKs\Windows\v7.1\Lib\x64\" -lSDL2main -lSDL2 -lglew32 -lOpenGL32.Lib -lGlU32.Lib
Iharob Al Asimi
  • 52,653
  • 6
  • 59
  • 97
Matze
  • 533
  • 7
  • 16

1 Answers1

0

Strangely these do also have the 32 suffix... whatever, probably for easier porting.

To maintain source compatibility with programs that use functions like LoadLibrary or GetModuleHandle: Keep them working without having to alter the strings that go into these functions.

If you look at the errors, it tells you it can't find the libraries ….lib. Note the .lib suffix. Now if you look at your linker command line you specified them as -lOpenGL32.lib and -lGLu32.lib which is wrong. The parameters passed to the -l parameter are the library names without standard filename prefixes or suffixes. The correct -l parameters would be -lopengl32 and -lglu32.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • strangely, netbeans didn't cut off the .lib suffix because the 'L' was written upper case. Simply renaming helped, thanks again – Matze Feb 22 '15 at 11:55