我一直在試圖將glut作爲靜態庫編譯,而不必在運行時與glut32.dll鏈接。我下載了過剩的窗口源代碼,但是當我嘗試編譯(默認),我不斷收到:在Windows上爲glut3.7構建一個靜態庫
Making in glut subdirectory...
link /INCREMENTAL:NO /NOLOGO -entry:[email protected] -dll -out:glut32.dll -def:glut.def glut_8x13.obj glut_9x15.obj glut_bitmap.obj glut_bwidth.obj glut_cindex.obj glut_cmap.obj glut_cu
rsor.obj glut_dials.obj glut_dstr.obj glut_event.obj glut_ext.obj glut_fullscrn.obj glut_gamemode.obj glut_get.obj glut_hel10.obj glut_hel12.obj glut_hel18.obj glut_init.obj glut_input.obj glut_joy.ob
j glut_key.obj glut_keyctrl.obj glut_keyup.obj glut_mesa.obj glut_modifier.obj glut_mroman.obj glut_overlay.obj glut_roman.obj glut_shapes.obj glut_space.obj glut_stroke.obj glut_swap.obj glut_swidth.
obj glut_tablet.obj glut_teapot.obj glut_tr10.obj glut_tr24.obj glut_util.obj glut_vidresize.obj glut_warp.obj glut_win.obj glut_winmisc.obj win32_glx.obj win32_menu.obj win32_util.obj win32_winproc.o
bj win32_x11.obj opengl32.lib glu32.lib winmm.lib kernel32.lib ws2_32.lib mswsock.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib
LINK : fatal error LNK1104: cannot open file 'glut32.lib'
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x450'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.EXE"' : return code '0x2'
Stop.
據我瞭解,glut32.lib應該被編譯並在{}源\ LIB \過剩創建\但它不在那裏。
任何幫助編譯過剩的靜態庫將不勝感激。
編輯:
在Makefile.win
更改:
$(link) $(LFLAGS) -out:$(GLUTDLL) -def:glut.def $(OBJS) $(LIBS)
到
lib $(OBJS) $(LIBS)
它產生\ LIB \過剩\ glut_8x13.lib不知道的8x13是關於什麼的,但是當我試圖與它聯繫起來,我得到了一些無法解析的外部:
GPURenderer_test.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: __thiscall GlobalDecl::OpenGLConte
xt::OpenGLContext(unsigned int,unsigned int)" ([email protected]@@[email protected]@Z)
GPURenderer_test.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: __thiscall GlobalDecl::OpenGLCon
text::OpenGLContext(unsigned int,unsigned int)" ([email protected]@@[email protected]@Z)
GPURenderer_test.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: __thiscall GlobalDecl::OpenG
LContext::OpenGLContext(unsigned int,unsigned int)" ([email protected]@@[email protected]@Z)
GPURenderer_test.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: __thiscall GlobalDecl::OpenGLCo
ntext::OpenGLContext(unsigned int,unsigned int)" ([email protected]@@[email protected]@Z)
GPURenderer_test.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: __thiscall GlobalDecl::OpenGLContext::Open
GLContext(unsigned int,unsigned int)" ([email protected]@@[email protected]@Z)
GPURenderer_test.obj : error LNK2019: unresolved external symbol [email protected] referenced in function "protected: void __thiscall GlobalDecl::OpenGLC
ontext::_executeTest(class GlobalDecl::UnitTest &)" ([email protected]@[email protected]@[email protected]@@Z)
感謝, 瑞安
請不要使用GLUT 3.7。 [使用FreeGLUT代替。](http://freeglut.sourceforge.net/) –
如果我正在嘗試做不起作用,我會用FreeGLUT嘗試。感謝您的建議。 – Ryan