opengl - I cant link against opengl32 in Windows for the life of me -


i'm new windows development. working on porting app of mine made in os x windows 10. i'm using visual studio 2015 community edition.

to project running, need link against glfw and, in windows understand, glew, since targeting gl 4.5.

so have glfw , glew libs. use cygwin have libs installed in usr/local/(bin | lib | include) mimic folder structure i'd use in os x these libs.

the issue i'm having opengl lib itself.

until yesterday, had managed project compiling , initializing glfw window following visual studio settings:

project->properties-> :

c++->general:

additional include directories:

c:\cygwin64\usr\local\include

linker->general:

additional library directories:

c:\cygwin64\usr\local\lib c:\cygwin64\usr\local\bin 

linker->input:

opengl32.dll glew32s.lib glfw3.lib 

the first thing notice linking against opengl32.dll, not .lib. saw bunch of questions / posts online state when install windows sdk have opengl32.lib in program files/microsoft sdks/windows (x86 or otherwise). not case me. have reinstalled windows 10 sdk , not install opengl lib, static nor dynamic, anywhere.

so i'm pretty sure opengl dll coming windows/system32 because place in whole machine there sort of opengl lib.

which makes me think might have had c:\windows\system32 in linker's additional library directories section. makes me think, because had set lot of struggle week ago. since able develop fine.

last night did commit work git branch, switch branch , merge branch. after merge, visual studio linker/c++ settings wiped. had recreate them, showed above.

now happens if include c:\windows\system32 , opengl32.dll vs spits out:

lnk1107 invalid or corrupt file: cannot read @ 0x2e0   openvrtest  c:\windows\system32\opengl32.dll 

and if don't include half stuff in glfw unresolved.

any hints how working again? makes no sense me... working fine , has have been working fine opengl32.dll

also side note, i'm not sure why people insist installing windows sdk installs static version of gl lib; @ least not me.

thanks!

linker->input:

opengl32.dll glew32s.lib glfw3.lib 

that opengl32.dll wrong. in windows development linker always takes .lib files. in case of static libraries .lib contains actual library binary. in case of dlls corresponding .lib informs linker dll use , symbols offers.

the main reason particular choice of how things done was, in windows development shall possible link against dll without having actual dll around.

also system libraries suffixed …32 on 64 bit systems.


Comments