Solution to a typical OpenGL Problem

Source: Internet
Author: User

Common Errors are as follows:

------------------ Configuration: glsample1-Win32 debug --------------------
Compiling resources...
Compiling...
Stdafx. cpp
D:/Microsoft Visual Studio/vc98/include/Gl. H (1152): Error c2144: syntax error: Missing '; 'before type 'void'
D:/Microsoft Visual Studio/vc98/include/Gl. H (1152): Error c2501: 'wingdiapi': Missing storage-class or type specifiers
D:/Microsoft Visual Studio/vc98/include/Gl. H (1152): Fatal error c1004: unexpected end of file found
Error executing cl.exe.

I have seen a lot of questions about this. In most OpenGL tutorials, only OpenGL support needs to include

# Include <Gl/Gl. h>
# Include <Gl/Glu. h>
# Include <Gl/Glaux. h>

Add opengl32.lib, glu32.lib, and Glaux to the project-> Settings-> link file. lib. For the above error, someone said that the # include <windows. h> put it in front of the file contained above. This is necessary, but it does not seem to solve the problem.

I tried it in the afternoon, including OpenGL support. In Project-> Settings-> link, opengl32.lib glu32.lib Glaux. Lib gdi32.lib user32.lib advapi32.lib is required.

The experiment is feasible and I hope to help you.

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.