Summary of problems encountered in compiling opengl code

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


#include < GL/glut.h>
Refer to the link
E:\OPENGL_Project\lightwithView\lightwithView\lightInViewSpace. Obj lightwithView”
“Error 13 error LNK2019: Cannot resolve external symbol [email protected], 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
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! this link explain more clearly, you can refer to.

Read More: