Home Database Mysql Tutorial Qt在VS2012中引用QtWidgets时报GLES2/gl2.h无法打开错误的解决办

Qt在VS2012中引用QtWidgets时报GLES2/gl2.h无法打开错误的解决办

Jun 07, 2016 pm 03:15 PM
g Quote

在VS2012中编译QT时,要使用控件就得引用QtWidgets。如下 #include QtWidgets 引入这个之后,VS会解出相关的文件,这时就可以正常使用相关的控件如QLabel/QLineEdit等,当然也可以通过#include QtWidgets/QLabel这样单一引用,不过每一类控件都需要引用一次

在VS2012中编译QT时,要使用控件就得引用QtWidgets。如下

#include <qtwidgets></qtwidgets>
Copy after login

引入这个之后,VS会解出相关的文件,这时就可以正常使用相关的控件如QLabel/QLineEdit等,当然也可以通过#include 这样单一引用,不过每一类控件都需要引用一次会很烦。所以统一引用QtWidgets。

代码正常编写的。但是编译时却出错了,如下图

Qt在VS2012中引用QtWidgets时报GLES2/gl2.h无法打开错误的解决办

错误指向的是GLES2/gl2.h,这个是QT自带的,所以在QT安装路径下一搜,发现果真有的。并且是在include/QtANGLE的文件夹下。看来是配置中没有带上。于是进行了配置,如下图。

Qt在VS2012中引用QtWidgets时报GLES2/gl2.h无法打开错误的解决办

在附加包含目录中添上$(QTDIR)\include\QtANGLE,其中$(QTDIR)是一个全局变量,指的是QT的目录。

再次编译,通过了。

作下记录,以备后用。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What do the 5G UC and 5G UW icons on your T-mobile smartphone mean? What do the 5G UC and 5G UW icons on your T-mobile smartphone mean? Feb 24, 2024 pm 06:10 PM

T-Mobile users have started noticing that the network icon on their phone screens sometimes reads 5GUC, while other carriers read 5GUW. This is not a typo, but represents a different type of 5G network. In fact, operators are constantly expanding their 5G network coverage. In this topic, we will take a look at the meaning of the 5GUC and 5GUW icons displayed on T-Mobile smartphones. The two logos represent different 5G technologies, each with its own unique characteristics and advantages. By understanding what these signs mean, users can better understand the type of 5G network they are connected to so they can choose the network service that best suits their needs. 5GUCVS5GUW icon in T

How to use block quotes in Apple Notes How to use block quotes in Apple Notes Oct 12, 2023 pm 11:49 PM

In iOS 17 and macOS Sonoma, Apple has added new formatting options for Apple Notes, including block quotes and a new Monostyle style. Here's how to use them. With additional formatting options in Apple Notes, you can now add block quotes to your notes. The block quote format makes it easy to visually offset sections of writing using the quote bar to the left of the text. Just tap/click the "Aa" format button and select the block quote option before typing or when you are on the line you want to convert to a block quote. This option applies to all text types, style options, and lists, including checklists. In the same Format menu you can find the new Single Style option. This is a revision of the previous "equal-width"

C++ compilation error: undefined reference, how to solve it? C++ compilation error: undefined reference, how to solve it? Aug 21, 2023 pm 08:52 PM

C++ is a popular programming language, but during use, the compilation error "undefined reference" often occurs, which brings a lot of trouble to program development. This article will discuss the solution to the "undefined reference" error from both the cause and the solution. 1. Cause of error When the C++ compiler compiles a source file, it will be divided into two stages: the compilation stage and the link stage. The compilation phase converts the source code in the source files into assembly code, while the linking phase combines different source files into an executable file.

What are the benefits of C++ functions returning reference types? What are the benefits of C++ functions returning reference types? Apr 20, 2024 pm 09:12 PM

The benefits of functions returning reference types in C++ include: Performance improvements: Passing by reference avoids object copying, thus saving memory and time. Direct modification: The caller can directly modify the returned reference object without reassigning it. Code simplicity: Passing by reference simplifies the code and requires no additional assignment operations.

Xpeng Motors invites Jimmy Lin to test drive G6, raising expectations for its return to the racing circuit Xpeng Motors invites Jimmy Lin to test drive G6, raising expectations for its return to the racing circuit Jun 05, 2023 pm 03:35 PM

According to news on June 5, Xpeng Motors officially announced this morning that it will soon launch the spokesperson for the new model Xpeng G6. Many netizens speculated that the spokesperson might be well-known artist Lin Zhiying. Xpeng Motors officially stated that the spokesperson for Xpeng G6 will be officially announced tomorrow, June 6. According to the editor's understanding, Lin Zhiying recently appeared at the Zhuhai Circuit wearing a racing suit and announced on social media that he would resume work and return, once again expressing his love for racing. In his Weibo, Lin Zhiying wrote: "The Zhuhai Circuit has many precious memories for me, and I am very happy to be back...I'mback, see you on June 6th!". This series of developments has attracted the attention of many netizens. It is worth noting that He Xiaopeng, chairman of Xpeng Motors, previously revealed: “I

How to use C++ reference and pointer parameter passing? How to use C++ reference and pointer parameter passing? Apr 12, 2024 pm 10:21 PM

References and pointers in C++ are both methods of passing function parameters, but there are differences. A reference is an alias for a variable. Modifying the reference will modify the original variable, while the pointer stores the address of the variable. Modifying the pointer value will not modify the original variable. When choosing to use a reference or a pointer, you need to consider factors such as whether the original variable needs to be modified, whether a null value needs to be passed, and performance considerations.

In-depth analysis of pointers and references in C++ to optimize memory usage In-depth analysis of pointers and references in C++ to optimize memory usage Jun 02, 2024 pm 07:50 PM

By using pointers and references, memory usage in C++ can be optimized: Pointers: store addresses of other variables and can point to different variables, saving memory, but may generate wild pointers. Reference: Aliased to another variable, always points to the same variable, does not generate wild pointers, and is suitable for function parameters. Optimizing memory usage can improve code efficiency and performance by avoiding unnecessary copies, reducing memory allocations, and saving space.

China Radio and Television 5G traffic reward activity: 40G national general traffic package free of charge China Radio and Television 5G traffic reward activity: 40G national general traffic package free of charge Sep 29, 2023 pm 07:09 PM

China Radio and Television announced on September 27, 2022 that all 31 provinces, autonomous regions and municipalities in the country, except Hong Kong, Macao and Taiwan, have officially opened 5G network services. This news marks that China Radio and Television has successfully built a 5G commercial system. In the context of celebrating the first anniversary of 5G commercial use, China Radio and Television announced the launch of an exciting event called " The Mid-Autumn Festival and National Day are 'adding' years, and you can get your radio and television traffic as you wish." According to the editor’s understanding, this event will be carried out from September 27th to October 6th. During the event, every China Radio and Television 192 primary card user has the opportunity to receive a 40G national universal traffic package for free. This traffic is valid within 10 days after receipt, and can also be shared with secondary cards to provide users with more convenience.

See all articles