I followed this topic: Building glew on windows with mingw but something went wrong here:
gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
I get this error:
C:\MinGW\dev_lib\glew-2.0.0>gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32 src/glew.o:glew.c:(.text+0x28f80): multiple definition of `DllMainCRTStartup@12' c:/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../dllcrt2.o:(.text+0x60): first defined here collect2.exe: error: ld returned 1 exit status
Thanks for help.
You need to link with the -nostdlib
option like so:
gcc -nostdlib -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
Glew defines DllMainCRTStartup which is also defined in the CRT. Hence your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With