簡體   English   中英

C ++項目構建,但IDE顯示錯誤

[英]C++ project build, but IDE shows error

Error: cannot open source file "GL/glew.h"

我有以下代碼:

//Include GLEW  
#include <GL/glew.h>  

//Include GLFW  
#include <GLFW/glfw3.h>  

//Include the standard C++ headers  
#include <stdio.h>  
#include <stdlib.h>  

//Define an error callback  
static void error_callback(int error, const char* description)
{
...

我從那里出發: http : //www.41post.com/5178/programming/opengl-configuring-glfw-and-glew-in-visual-cplusplus-express#part4

為了提供一個可移植的解決方案,甚至在我啟動Visual Studio 2013之前,我都在Windows中創建了兩個系統環境變量。

GLEW=C:\\Install\\Development\\C++\\Framework\\glew-1.10.0-win32\\glew-1.10.0 GLFW=C:\\Install\\Development\\C++\\Framework\\glfw-3.0.4.bin.WIN32\\glfw-3.0.4.bin.WIN32

因此,在我的項目中,我可以例如編寫一個附加的include文件夾,如: %GLEW%\\include

就像我說的那樣,它可以很好地運行。

但是,沒有智能感知的行為確實很煩人。 如何解決?

我的語法實際上是錯誤的,您無法在VS中使用%<name>%使用全局環境變量,但必須使用$(%<name>)。

無論我在哪里寫%GLEW%\\include我都應該有$(GLEW)\\include

現在工作正常。

盡管我完全不知道它為什么建。

這篇文章: https : //stackoverflow.com/a/11543754/910813讓我提醒了一下。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM