Tag Archives: Compile vs.

Summary of problems encountered in compiling opengl code

one
Error 1 C2381: “exit” : redefinition; __declspec(noreturn) “This type of error is caused by the wrong order of reference header files,
Solutions:
Switch the inclusion order of the header file:
#include < GL/glut.h>
#include < stdlib.h>

#include

stdlib.h>    
#include < GL/glut.h>
Refer to the link https://www.cnblogs.com/rainbow70626/p/10732342.html
 
two
E:\OPENGL_Project\lightwithView\lightwithView\lightInViewSpace. Obj lightwithView”
“Error 13 error LNK2019: Cannot resolve external symbol __imp__glClearColor@16, which is referenced in function _main E:\OPENGL_Project\lightwithView\ lightWithview \ lightinViewSpace. Obj lightwithView”
Glew32s.lib is a static library, not a dynamic library, so Glut. h is added.
#include < GLEW/glew.h> It must be preceded by #define GLEW_STATIC
 
 
three
LINK: warning LNK4098: default library ‘MSVCRT’ conflicts with other libraries Please use/NODEFAULTLIB: the cause of the library “is trying to incompatible library links, such as SOIL link libraries, originally provided by the website is libSOIL. A file, but directly use the static library files may output of the error, and error” unparsed external symbol __alloca in function _stbi_zlib_decode_noheader_buffer reference “, this time as long as the SOIL’s own project on its own compiler to generate the corresponding SOIL. The lib files, Replace libsoil. LIB file, problem solved!
https://blog.csdn.net/iscassucess/article/details/8302264 this link explain more clearly, you can refer to.