NonEuclidean icon indicating copy to clipboard operation
NonEuclidean copied to clipboard

visual studio 2019 compilation errors

Open bwanaaa opened this issue 5 years ago • 8 comments

I put a fresh copy of glew-2.2.0 into main non-Euclidean folder. I edited VC++ Directories to be: ..\glew-2.2.0\lib\Release\x64;$(LibraryPath) I edited C/C++ Additional Include Directories to be: ..\glew-2.2.0;%(AdditionalIncludeDirectories) I edited

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E1696	cannot open source file "GL/glew.h"	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	3	
Error (active)	E0020	identifier "glDepthFunc" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	48	
Error (active)	E0020	identifier "GL_ALWAYS" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	48	
Error (active)	E0020	identifier "glUseProgram" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	49	
Error (active)	E0020	identifier "glBegin" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	50	
Error (active)	E0020	identifier "GL_LINE_LOOP" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	50	
Error (active)	E0020	identifier "glColor3f" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	51	
Error (active)	E0020	identifier "glVertex4f" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	57	
Error (active)	E0020	identifier "glEnd" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	65	
Error (active)	E0020	identifier "GL_LESS" is undefined	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	66	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Camera.cpp	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Collider.cpp	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Mesh.h	4	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Mesh.h	4	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\FrameBuffer.h	3	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Mesh.h	4	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Shader.h	2	
Error	C1083	Cannot open include file: 'GL/glew.h': No such file or directory	NonEuclidean	C:\Users\Stefan\Desktop\NonEuclidean-master\NonEuclidean\Texture.h	2	

glew.h is there but is not being found. help??

bwanaaa avatar Apr 12 '20 19:04 bwanaaa

Hey! ~~glew.h is a header file from the project's folder, it doesn't have to be moved anywhere because it's exactly where it's supposed to be :) But, y~~You're right, there is a problem to be solved - the thing that's not being found is the glew library.

As stated here, glew is a required library (aka dependency), so you must install it first (if there would've been more, you would've had to install them all).

You can install most libraries (aka dependencies, or packages) with a package manager. I used NPM (node package manager), which is included in Node.js, a runtime environment for JavaScript (completely unrelated but NPM does the job). You can also use APT (the famous command apt-get in a Linux terminal), yum, RPM, Homebrew (aka brew) or others.

If you want the simple solution, go ahead and install Node.js (see this page), then press Windows Key+R* and type cmd, press Enter or click Run, and you should see the console appear. Type npm install glew, press Enter and you're set! After it's done installing, you should be able run the executable file.

If you're on Mac, press Command Key+Space to launch Spotlight and then type "Terminal". Type npm install glew just the same way.

Sorry for taking long to reply, I wanted to flesh this answer out for anyone else having trouble. Hopefully it helped :)

primedcore avatar Apr 12 '20 20:04 primedcore

Sorry I didn't properly look into your problem.

I edited VC++ Directories to be: ..\glew-2.2.0\lib\Release\x64;

Can you try editing them to glew-2.2.0\include and recompiling everything? Does that fix the problem?

primedcore avatar Apr 12 '20 20:04 primedcore

I have tried these changes:

https://imgur.com/a/UN8TLqG

and it still fails.

I also tried putting '\GL' after 'include and it still fails.

bwanaaa avatar Apr 13 '20 18:04 bwanaaa

and even after I make these changes and save the project, I cannot find any mention of 'glew' in the list of files in the 'solution explorer'. Sorry but I am not familiar with the details of visual studio. I must be missing something fundamental.

bwanaaa avatar Apr 13 '20 18:04 bwanaaa

@HackerPoet Sorry for tagging, but I have no idea what's going on either.

primedcore avatar Apr 13 '20 20:04 primedcore

Yup same problem here, downloaded VS just for this (never used it before so maybe I just do something terribly wrong)

I added glew to NonEuclidean and changed all <GL/glew.h> to "GL/glew.h".

This solved all the problems with glew not being found but it creates 616 other errors, including suddenly not finding <Windows.h> anymore??

Cook-I-T avatar May 20 '20 21:05 Cook-I-T

I found this because I was having similar issues. Note that this was done in 2017 but hopefully it helps.

I downloaded the glew 2.1.0 binary and copied a few files over into the main NonEuclidean folder:

  • contents of glew-2.1.0\lib\Release\x64 (glew32.lib and glew32s.lib) into a new folder in NonEuclidean, lib
  • contents of glew-2.1.0\include\GL (header files) into new NonEuclidean folder(s) include\GL

(some of these files are probably unnecessary)

Then, in the Project Properties (in Solution Explorer right click the project -> Properties) I added ./include (literally "./include") as an Additional Include Directory under C/C++ -> General -> Additional Include Directories. I also added ./lib under Linker -> General -> Additional Library Directories.

With this setup I'm able to build and run without any code changes.

DJKerr avatar Jul 07 '20 22:07 DJKerr

That reminds me, I'm kind of surprised this is set up as a Visual Studio project. I heard that Visual Studio is awesome with C#, but personally I made the experience that with C++ it's even more disgusting than Eclipse.

ehx-v1 avatar Jul 09 '20 11:07 ehx-v1