Error LNK2019: unresolved external symbol ___glutinitwithexit@12, which is referenced 1>gears.obj:error LNK2019 in function _glutinit_atexit_hack@8: unresolved external symbol ___gl__ function

Source: Internet
Author: User

OpenGL advanced Rookie question read a book, "OpenGL three-dimensional graphics system development and application Technology", however, which involves to the Glut.h file function is not properly connected, the typical error is as follows:------started build: Project: Gears, Configuration: Debug Win32-- ----1> are linking ... 1>gears.obj:error LNK2019: unresolved external symbol ___glutinitwithexit@12, which is referenced in function _glutinit_atexit_hack@8 1>gears.obj: Error LNK2019: unresolved external symbol ___glutcreatewindowwithexit@8, which is referenced in the function _glutcreatewindow_atexit_hack@4 1>./debug/ Gears.exe:fatal error Lnk1120:2 an unresolved external command 1> build log is saved in the file://c:/vcprog/OpenGL/book/Chapter03/GEARS/Debug/ BuildLog.htm "1>gears-3 error, 0 warnings ========== generated: 0 has been successful, 1 has failed, 0 is up to date, 0 has skipped ==========, has not found the answer, the Internet has said similar problems, but there is no such aspect of the solution, today read the glut.h of the file content, Glut.h comments actually wrote the following: Note that the __glut*withexit routines should never is called directly. To avoid the atexit workaround, #define Glut_disable_atexit_hack. So, in # include <GL/glut.h> preceded by a sentence: #define Glut_disable_atexit_hack again link, everything is normal. This problem almost bothered me for three months, today finally solved, the road is 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.