Visual C++ .NET pissing me off.

Started by
9 comments, last by AndreTheGiant 20 years, 1 month ago
Im trying to build a Windows opengl program in visual c++, but Im getting these errors:

Heightmap fatal error LNK1120: 7 unresolved externals
Heightmap error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReshapeGL(int,int)" (?ReshapeGL@@YAXHH@Z)
Heightmap error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReshapeGL(int,int)" (?ReshapeGL@@YAXHH@Z)
Heightmap error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReshapeGL(int,int)" (?ReshapeGL@@YAXHH@Z)
Heightmap error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReshapeGL(int,int)" (?ReshapeGL@@YAXHH@Z)
Heightmap error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function _WinMain@16
Heightmap error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function _WinMain@16
Heightmap error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function _WinMain@16
Im guessing that I have to link external stuff, like the opengl library, and some windows libs, like I did with VC++ 6. But with .NET, I cant find where to do it! Ive looked everywhere and its very frustrating.
Advertisement
Tools->Options->Projects->VC++ Directories->Select "Libraries" from the "Show Directories for:" dropdown.



Cheers,
Paul Cunningham

Pumpkin Games

[edited by - paulcunningham on March 23, 2004 5:29:58 PM]
Cheers,Paul CunninghamPumpkin Games
Thanks PCh,

It seems that it was already set up to include the right directory. So any ideas about why I am getting these errors?
Project properties->Linker->Input->Additional Dependencies. You need to add the name of each library explicitly. If it is in one of the directories specified in the dialog Paul mentioned, you can just give the name. Otherwise, you will have to give an absolute or relative(to the project directory) path.

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Thanks again,

but I''m afraid that "Project properties" does not exist! Where is it supposed to be?

Sorry for the dumb question, but I really have been at this for a while now
It should be on the menu under Project. Then choose properties (at very bottom). The menus change based on what you are currently looking at so maybe that''s why you can''t see it. You need to have the project opened. If you are looking at one of your source files then it should be in the menu. You can also right click on the project name in the right-hand side (where your file are listed under source, headers, etc.) and choose properties there.

Tadd
- WarbleWare
Tadd- WarbleWare
Ok slowly getting somewhere (i hope) but ive run into another problem. I got into project->properties (I had the solution explorer closed, which apparently disabled properties from the project menu), but now there is nothing anywhere that mentions linker. Maybe a picture is in order:

Hmm, I''m not sure (don''t have VS in front of me now), but I''d guess that pic shows the "Solution Properties" not the "Project Properties". A solution can have multiple projects in it, each with its own properties. Have you added files to your project yet? I''ve always added files before changing project properties. So maybe that matters. In the Solution Explorer, you should be able to right-click on the project name (not solution name) to get project props.

Tadd
- WarbleWare
Tadd- WarbleWare
In the solution explorer, rightclick the project name,
(not the solution at the top), then properties->Linker->Input.
At the top of that page you have "Additional Dependencies",
add the libs your project need on that line.

[Edit], Dang, reana1 beat me to it.


[edited by - Allmight on March 23, 2004 6:32:10 PM]
-------------------------------------------------Founder and DirectorAllSoft Studios
#pragma comment(lib, "libname.lib")

will do just fine...

This topic is closed to new replies.

Advertisement