开发者

Unable to link to opengl libraries? DOS / MSVC

Is there something wrong with this link.exe command line? OpenGL32.lib and Glu32.lib are found at both of the LIBPATH directories. Is it possible the libraries are somehow incompatible? Is there a way to have the link.exe say that instead of unresolved external symbol? Googling shows that this error usually means the libraries are not found, but they are there.

E:\mvs90\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:no /DEBUG /pdb:None /LIBPATH:E:\code\python\python\py26\libs /LIBPATH:E:\code\python\python\py26\PCbuild 
opengl32.lib glu32.lib 
/EXPORT:init_rabbyt build\temp.win32-2.6-pydebug\Debug\rabbyt/rabbyt._rabbyt.obj 
/OUT:build\lib.win32-2.6-pydebug\rabbyt\_rabbyt_d.pyd 
/IMPLIB:build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.lib 
/MANIFESTFILE:build\temp.win32-2.6-pydebug\Debug\rabbyt\_开发者_如何学Gorabbyt_d.pyd.manifest

   Creating library build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.lib and
object build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.exp
rabbyt._rabbyt.obj : error LNK2019: unresolved external symbol __imp__glOrtho re
ferenced in function ___pyx_f_6rabbyt_7_rabbyt_set_viewport

 Directory of E:\code\python\python\py26\libs
09/27/2007  02:20 PM            12,672 GlU32.Lib
09/27/2007  02:20 PM            76,924 OpenGL32.Lib


It seems likely given your success with Cygwin and MSYS that these are Cygwin/GCC or MinGW/GCC export libraries and not MSVC export libraries. They will not be recognised as valid by Microsoft's linker, and will be ignored.

The correct OpenGL32.lib and Glu32.lib files are part of the Windows SDK. For the VS2008 SDK, it is at C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib (your installation may vary).

Glaux.lib is apparently deprecated and is no longer included in the Windows SDK. Download and install the older VS2005 SDK to obtain the header and export libraries if you need them. The older SDK will be installed at "C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK" while the VS2008 SDK is at "C:\Program Files\Microsoft SDKs\Windows\v6.0A", you can simply copy the necessary files to the corresponding folder in the newer SDK.

You could of course just build with VS2005 or earlier rather than mess with the SDK.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜