Advertisement

Visual C++ .NET Standard

Started by December 17, 2002 09:09 AM
8 comments, last by Exodus2003 21 years, 10 months ago
Hey all, I''m very new to programming in OpenGL, and I was reading one of NeHe''s tutorials, and i tryed making it but it didn''t work. I was wondering if one of you could help me out. Like the title says I have Visual C++ .NET Standard. Which I think is 7.0, and is differant from 6.0, so I can''t follow along with the tutorial. Thanx in advance! -Gene
I''m using Visual Studio .NET too.. exactly what bit couldn''t you do from the tutorials?.. I''ll help out where possible.
"Build a man a fire, and he will be warm for a day. Set a man on fire, and he will have warmth for the rest of his life"
Advertisement
I keep getting error messages, for example something like

___@WinMAin
___@CRTerror

I also can''t get the linker to link to OpenGL.
I''ll turn it on and get some real error for you.
I go to File > New > Project I select Win32 App. The dialog box wizard shows up. Do I click "Finish" or do I get an empty Project? I chose empty file. I right click on sources and select Add > Add New Item. The wizard comes up again and I choose C++ Source (*.cpp) and save it as Apok. I copy the source from tutorial 1 and paste it into main.cpp, then i save it. Then I go into Buil > Build 110 <- Which is my project name. Heres some errors:

110 error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

110 error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "int __cdecl LoadGLTextures(void)" (?LoadGLTextures@@YAHXZ)

110 error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)

110 error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)

And I have 20 more errors like these. Than i have:

110 fatal error LNK1120: 24 unresolved externals
and
d:\Documents and Settings\Exodus\Desktop\Apokalypse\110\Apok.cpp(469): warning C4244: ''return'' : conversion from ''WPARAM'' to ''int'', possible loss of data

I''m not exactly sure how .net works but, you guys did include the open gl libraries, right?
It''s a Link error which leads me to think that you''re missing the required .lib files.

If you read the intro to NeHe''s first windows tutorial, he clearly explains which files are needed.

Appologies if this isn''t the problem, but it''s the first thing I''d check.
I like pie! - weebl.
Oneiric - Another graphics engine in the works.
Advertisement
I''m having the same problem, I think it''s that I haven''t included the Libraries, but NeHe''s tutorial doesn''t explain how to link libraries in C++ .NET, it is written for 6.0. Any help would be greatly appreciated. I already tried putting:

#pragma comment(lib, "OpenGL32.lib"
#pragma comment(lib, "GLu32.lib"
#pragma comment(lib, "GLaux.lib"

at the start but it didn''t work either.

The_Ethernopian
With the C++ project selected (not the ''solution'' or anything like that) do Project->Properties. Go to Linker, then Input. Under the ''additional dependencies'' simply type in all of the libraries you want to add. I really have no idea why the pragma thing didn''t work, though...it worked for me.
You also have to make sure that the libraries are in the library search path. I don't have the right mahcine here right now, but if I remember correctly you get there from Options in one of the main menus. Then find where you specify search oaths, select the linker search path and make sure it can find your gl libraries.

edit: OK, somebody beat me to it

[edited by - DGates on April 23, 2003 2:31:26 AM]
Im using .NET and all NeHe's tuts work fine...you libraries are definetly not being linked...Here is the header to use

#include <windows.h>
#include <gl\gl.h> //header for OpenGL32 Lib
#include <gl\glu.h> //GLu32 Lib
#include <gl\glaux.h> //GLaux Lib

//include these libraries
#pragma comment(lib, "OpenGL32.lib")
#pragma comment(lib, "GLu32.lib")
#pragma comment(lib, "GLaux.lib")

dont worry about setting any compiler specific settings...if you include the above in your source you should be good to go...

Check out: [a href="http://www.lanceusa.com"]

[edited by - dnagcat on April 23, 2003 2:59:29 PM]

This topic is closed to new replies.

Advertisement