Visual Studio.net

Started by
37 comments, last by CoMpFreaK 20 years, 8 months ago
Hey, I used to use MVC++ 6.0 to do things for me, but recently i have received a copy of visual studio.net academic and would like to start doing opengl programming with it. I was wondering if anyone out there knew how to set up visual studio.net for opengl programming and could show me how. Thanks!
Advertisement
Its basically the same as VC++ 6 if you''re using VC++.net. They''ve moved some of the menus around but all you really need to know about is where to include the GL libraries at. Go to Project->Properties and then click Linker on the left side. Click on Input and then add the OpenGL Libraries and any other libraries you are going to use into the "Additional Dependencies" Field, separating them with spaces.
Hey cool thats exactly what i was looking for.
I also have another problem i put in the following code:
#include <gl/gl.h>
#include <gl/glut.h>

void display(void)
{
glClear (GL_COLOR_BUFFEER_BIT);

glColor3f (1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0);
glVertex3f(0.25, 0.75, 0.0);
glEnd();

glFlush ();
}
void init (void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (250, 250);
glutInitWindoPosition (100, 100);
glutCreateWindow ("hello");
init ();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}

when i build this i get this:
c:\Nathan\Projects\opengl1\opengl1.cpp(40): fatal error C1010: unexpected end of file while looking for precompiled header directive

io looked in help and it said something about accedinteley
deleting the #include <.h> that the program is looking for.
know whats wrong?


You need to disable the use of precompiled headers in the project options.

How appropriate. You fight like a cow.
How do yah do that?


_________________________________________________________________
IM DUM!!!
Dunno. Look around in the project options. Maybe you''ll learn a few things while doing it.
oh but i get this now!!!
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2146: syntax error : missing '';'' before identifier ''glAccum''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2146: syntax error : missing '';'' before identifier ''glAlphaFunc''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1153): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1154): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1154): error C2146: syntax error : missing '';'' before identifier ''glAreTexturesResident''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1154): error C2146: syntax error : missing '';'' before identifier ''GLboolean''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1154): error C2371: ''APIENTRY'' : redefinition; different basic types
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1154): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1155): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1155): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1155): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1155): error C2146: syntax error : missing '';'' before identifier ''glArrayElement''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1155): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1155): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1156): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1156): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1156): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1156): error C2146: syntax error : missing '';'' before identifier ''glBegin''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1156): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1156): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1157): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1157): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1157): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1157): error C2146: syntax error : missing '';'' before identifier ''glBindTexture''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1157): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1157): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1158): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1158): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1158): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1158): error C2146: syntax error : missing '';'' before identifier ''glBitmap''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1158): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1158): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1159): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1159): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1159): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1159): error C2146: syntax error : missing '';'' before identifier ''glBlendFunc''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1159): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1159): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1160): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1160): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1160): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1160): error C2146: syntax error : missing '';'' before identifier ''glCallList''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1160): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1160): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1161): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1161): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1161): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1161): error C2146: syntax error : missing '';'' before identifier ''glCallLists''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1161): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1161): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1162): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1162): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1162): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1162): error C2146: syntax error : missing '';'' before identifier ''glClear''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1162): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1162): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1163): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1163): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1163): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1163): error C2146: syntax error : missing '';'' before identifier ''glClearAccum''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1163): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1163): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1164): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1164): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1164): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1164): error C2146: syntax error : missing '';'' before identifier ''glClearColor''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1164): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1164): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1165): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1165): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1165): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1165): error C2146: syntax error : missing '';'' before identifier ''glClearDepth''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1165): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1165): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1166): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1166): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1166): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1166): error C2146: syntax error : missing '';'' before identifier ''glClearIndex''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1166): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1166): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1167): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1167): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1167): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1167): error C2146: syntax error : missing '';'' before identifier ''glClearStencil''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1167): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1167): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1168): error C2086: ''int APIENTRY'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1168): error C2086: ''int WINGDIAPI'' : redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1168): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1168): error C2146: syntax error : missing '';'' before identifier ''glClipPlane''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1168): error C2182: ''APIENTRY'' : illegal use of type ''void''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1168): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1169): error C2144: syntax error : ''void'' should be preceded by '';''
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1169): error C2501: ''WINGDIAPI'' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1169): fatal error C1003: error count exceeds 100; stopping compilation





Something is wrong with gl.h i think.

Are you compiling an MFC project? If so you need #include <stdafx.h>... However, I think you probably want to make a simple Win32 application or Win32 console application.
Is windows.h included BEFORE the OpenGL headers?

[twitter]warrenm[/twitter]

Just include "windows.h"

---------------------------------------------
If God with me, Who against me?
Sitio de desarrollo de videojuegos en español
Digital Moon Studio...

There is no spoon
--------------------------------------------- If God with me, Who against me?Personal Web Samuel Prince Blog...

This topic is closed to new replies.

Advertisement