How can I add GLEW/Other includes in Visual Studio

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

55 Replies - 1383 Views - Last Post: 02 February 2018 - 05:29 PM Rate Topic: -----

#1 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 04:27 PM

Hello I am trying to make a window in c++ and OpenGL but the only issue is when I try to compile it in the developer command prompt it says it can't find GL/glew.h and I have no idea how to fix it... Anyone know how I can fix this?
Is This A Good Question/Topic? 0
  • +

Replies To: How can I add GLEW/Other includes in Visual Studio

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14045
  • View blog
  • Posts: 56,214
  • Joined: 12-June 08

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 04:38 PM

Did I grab the nugget package?

http://in2gpu.com/20...io-using-nuget/
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6166
  • View blog
  • Posts: 21,273
  • Joined: 05-May 12

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 04:38 PM

Set the INCLUDE environment variable to iclude the directory above the "GL" directory.
Was This Post Helpful? 0
  • +
  • -

#4 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 04:51 PM

View PostSkydiver, on 30 January 2018 - 04:38 PM, said:

Set the INCLUDE environment variable to iclude the directory above the "GL" directory.


How would I do that?

View Postmodi123_1, on 30 January 2018 - 04:38 PM, said:

Did I grab the nugget package?

http://in2gpu.com/20...io-using-nuget/


No but I will try that now...
Was This Post Helpful? 0
  • +
  • -

#5 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 05:03 PM

The NuGet solution worked thanks :smile2:
Was This Post Helpful? 0
  • +
  • -

#6 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 05:35 PM

Ok now I a getting two errors

Quote

LNK2019 unresolved external symbol __imp_glClear referenced in function main Window C:\Users\flami\source\repos\Window\Window\main.obj

Quote

LNK2019 unresolved external symbol __imp_glClearColor referenced in function main Window C:\Users\flami\source\repos\Window\Window\main.obj

How would I fix these errors?
Was This Post Helpful? 0
  • +
  • -

#7 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6166
  • View blog
  • Posts: 21,273
  • Joined: 05-May 12

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 06:36 PM

Did you link in OpenGL32.lib?
Was This Post Helpful? 0
  • +
  • -

#8 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 07:08 PM

View PostSkydiver, on 30 January 2018 - 06:36 PM, said:

Did you link in OpenGL32.lib?


I tried but it seems like nothing changed...
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6166
  • View blog
  • Posts: 21,273
  • Joined: 05-May 12

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 07:18 PM

Show us your command line for building your program. If you are using a MSBuild project file, or a Makefile, the contents of those files would be useful as well.

Are those the only link errors? Or do you have other errors before that? Do you have any compiler warnings?
Was This Post Helpful? 0
  • +
  • -

#10 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 07:22 PM

I only have three errors, the previous two and on that says there are two errors. the command line code (cl /EHsc nameofcppfile.cpp) does not work it still says it can not find GL/glew, I am pressing F5 to build the project in visual studio...

EDIT: I am using "Developer Command Prompt for Visual Studio"

This post has been edited by Skydiver: 30 January 2018 - 07:29 PM
Reason for edit:: Removed unnecessary quote. No need to quote the post above yours.

Was This Post Helpful? 0
  • +
  • -

#11 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6166
  • View blog
  • Posts: 21,273
  • Joined: 05-May 12

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 07:41 PM

If you are using the "Developer Command Prompt for Visual Studio", the pressing F5 don't do anything. You to specify a command line that is more than just some exception handling flags. You will need to specify what libraries to link in. If you don't set the INCLUDE and LIBPATH environment variables, then you will also have to specify parameters that tell the compiler and linker where to look for files.

Alternatively, you can use MSBuild and pass in the .vcxproj, or devenv.exe and pass in the .sln file.

If you are using Visual Studio, F5 runs the current project. If the current project is not currently built, then it will try to build it.

Please post the contents of your .vcxproj file. (Not a screenshot please.)

As we told you in previous threads:
  • There is no need to quote the post above yours. Just use the big Reply button or the Fast Reply area.
  • Post the exact errors you are getting. Don't paraphrase or delete information.

Was This Post Helpful? 0
  • +
  • -

#12 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

Re: How can I add GLEW/Other includes in Visual Studio

Posted 30 January 2018 - 07:57 PM

Where would devenv.exe be located? and I told you my errors in as much detail and did not leave anything (important) out, the reason I left out the third error is because it actually just says there are two errors
Was This Post Helpful? 0
  • +
  • -

#13 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1460
  • View blog
  • Posts: 4,726
  • Joined: 20-March 10

Re: How can I add GLEW/Other includes in Visual Studio

Posted 31 January 2018 - 07:20 AM

The errors you are getting come from glut the opengl utility library

It seems the code you are using relies not only on glew but glut

https://www.opengl.o...libraries/glut/

If you knew what you were doing... this would be obvious to you...

If you want the whole shebang from nuget I would suggest typing the following into the nuget console package manager.

Install-Package nupengl.core -Version 0.1.0.1 and this will install FreeGLUT, GLFW and GLEW.

You may or may not need GLFW but you would be safer to install everything at this point.

This post has been edited by snoopy11: 31 January 2018 - 07:22 AM

Was This Post Helpful? 0
  • +
  • -

#14 FlamingBurrito15   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 13-December 17

Re: How can I add GLEW/Other includes in Visual Studio

Posted 31 January 2018 - 09:36 AM

I already put that code in yesterday when I said NuGet was working so I don't think that is the issue...
Was This Post Helpful? 0
  • +
  • -

#15 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14045
  • View blog
  • Posts: 56,214
  • Joined: 12-June 08

Re: How can I add GLEW/Other includes in Visual Studio

Posted 31 January 2018 - 09:38 AM

Make sure you are using the right libraries for the project type.. 32bit for 32.. 64 to 64.
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »