HackerPoet / NonEuclidean

A Non-Euclidean Rendering Engine for 3D scenes.
MIT License
6.1k stars 581 forks source link

visual studio 2019 compilation errors #18

Open bwanaaa opened 4 years ago

bwanaaa commented 4 years ago

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??

primedcore commented 4 years ago

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, yYou'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 commented 4 years ago

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?

bwanaaa commented 4 years ago

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 commented 4 years ago

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.

primedcore commented 4 years ago

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

Cook-I-T commented 4 years ago

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 anymore??

DJKerr commented 4 years ago

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:

(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.

ehx-v1 commented 4 years ago

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.