Archived

This topic is now archived and is closed to further replies.

Visual C++ .NET pissing me off.

This topic is 5016 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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:

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Ok that seems to have helped (program still wont run, but I think thats a different story). Thanks for your patience, everyone. I guess what really confused me is that Ive never done this linker set up stuff before, but I have a couple other projects that all use opengl with no problem.
wierd.

Share this post


Link to post
Share on other sites