简体   繁体   中英

C++ project build, but IDE shows error

I have the following code :

//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)
{
...

I took from there: http://www.41post.com/5178/programming/opengl-configuring-glfw-and-glew-in-visual-cplusplus-express#part4

In order to have a somewhat portable solution, before I even started Visual Studio 2013 I created two System Environment Variable in 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

So in my project I could for instance write a additional include folder as: %GLEW%\\include

As I said, it builds fine and runs fine as well.

Yet, not having intellisense behave properly is really annoying. How to fix it?

My syntax was actually wrong, you cant use global environment variable in VS using %<name>% but you have to use $(%<name>).

Wherever I wrote %GLEW%\\include I should have $(GLEW)\\include .

It's working fine now.

Though I'm completely clueless why it built.

This post: https://stackoverflow.com/a/11543754/910813 got me to remind that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM