Linking...
圖形.obj : error LNK2001: unresolved external symbol ___glutInitWithExit@12
圖形.obj : error LNK2001: unresolved external symbol ___glutCreateWindowWithExit@8
Debug/圖形.exe : fatal error LNK1120: 2 unresolved externals
執行 link.exe 時出錯.
是什么意思,實在不知道咋配置了,求各位大神指點,謝謝!
uj5u.com熱心網友回復:
see 'glut.h'#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI void APIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
//
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI int APIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
//
/* Win32 has an annoying issue where there are multiple C run-time
libraries (CRTs). If the executable is linked with a different CRT
from the GLUT DLL, the GLUT DLL will not share the same CRT static
data seen by the executable. In particular, atexit callbacks registered
in the executable will not be called if GLUT calls its (different)
exit routine). GLUT is typically built with the
"/MD" option (the CRT with multithreading DLL support), but the Visual
C++ linker default is "/ML" (the single threaded CRT).
One workaround to this issue is requiring users to always link with
the same CRT as GLUT is compiled with. That requires users supply a
non-standard option. GLUT 3.7 has its own built-in workaround where
the executable's "exit" function pointer is covertly passed to GLUT.
GLUT then calls the executable's exit function pointer to ensure that
any "atexit" calls registered by the application are called if GLUT
needs to exit.
Note that the __glut*WithExit routines should NEVER be called directly.
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
uj5u.com熱心網友回復:
注意函式名 多是__glutInitWithExit
一旦 這樣
#define GLUT_DISABLE_ATEXIT_HACK
#include "glut.h"
就是沒定義 !!
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/122926.html
標籤:基礎類
下一篇:VC++呼叫Excel模板列印
