Home > Software engineering >  In vc6.0 link error 2001
In vc6.0 link error 2001

Time:10-09

Linking...
Graphics. Obj: error LNK2001: unresolved external symbol ___glutInitWithExit @ 12
Graphics. Obj: error LNK2001: unresolved external symbol ___glutCreateWindowWithExit @ 8
The Debug/graphics. Exe: fatal error LNK1120:2 unresolved externals
An error occurred when execution link. Exe.
What do you mean, really don't know how configuration, please everyone a great god give directions, thank you!

CodePudding user response:

See the 'glut. H'
# if defined (_WIN32) & amp; & ! Defined (GLUT_DISABLE_ATEXIT_HACK)
GLUTAPI void APIENTRY __glutInitWithExit (int * argcp, char * * argv, void (__cdecl * exitfunc) (int));
//
# if defined (_WIN32) & amp; & ! 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 the company a CRT
The from the GLUT DLL, the DLL will GLUT not share the same CRT static
The data seen by the executable. In particular, atexit callbacks registered
In the executable will not be called if GLUT calls its (the company)
The exit routine). GLUT is typically built with the
"/MD" option (the CRT with multithreading DLL support), but the Visual
C + + would default is "/ML" (the single threaded CRT).

One workaround to this issue is requiring users to always link with
The same as the CRT GLUT is compiled with. That requires the 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 the if GLUT
Needs to exit.

Note that the __glut * WithExit routines should NEVER be called directly.
To get the atexit workaround, # define GLUT_DISABLE_ATEXIT_HACK. */

CodePudding user response:

Pay more attention to the function name is more
__glutInitWithExit

Once this
# define GLUT_DISABLE_ATEXIT_HACK
# include "glut. H"

Is not defined!!!!!

  • Related