Error LNK2019: An external symbolic ___glutinitwithexit@12 that cannot be resolved, which is referenced in the function _glutinit_atexit_hack@8 1>gears.obj:error LNK2019: unresolved external symbol ___gl__ function

Source: Internet
Author: User

OpenGL's top rookie question read a book "OpenGL three-dimensional graphics system development and application Technology", however, the function involved in the Glut.h file is not properly connected, the typical error is as follows:------started build: Project: Gears, Configuration: Debug Win32-- ----1> is being linked ... 1>gears.obj:error LNK2019: unresolved external symbol ___glutinitwithexit@12, which is referenced in the function _glutinit_atexit_hack@8 1>gears.obj: Error LNK2019: An external symbolic ___glutcreatewindowwithexit@8 that cannot be resolved, which is referenced in the function _glutcreatewindow_atexit_hack@4 1>./debug/ Gears.exe:fatal error Lnk1120:2 an unresolved external command 1> the build log is saved in the file://c:/vcprog/OpenGL/book/Chapter03/GEARS/Debug/ BuildLog.htm "1>gears-3 error, 0 warnings ========== build: 0 has succeeded, 1 has failed, 0 latest, 0 has skipped ========== repeatedly thinking, also did not find the answer, the Internet also has said similar question, but unexpectedly did not have this aspect of the solution, today read the glut.h of the file content, glut.h annotation unexpectedly wrote the following: Note this __glut*withexit routines should is NEVER called. To avoid the atexit workaround, #define Glut_disable_atexit_hack. So, in front of the #include <GL/glut.h> added a: #define Glut_disable_atexit_hack again link, all normal. This problem almost bothered me for three months, today finally resolved, the road at the foot, happy ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.