Jump to content
  • Advertisement


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


Do I need another library linked? unresolved external symbol _main

This topic is 6179 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

Ok, umm... well, I was informed how to manually link libraries from a user here on GDNet, which is great (I have TWO BOOKS on Visual C++, and two books on windows game programming, and NONE of them -- including the one by Dave Astle and Kevin Hawkins -- bothers to deal with the library linking that you MUST do to make things work)... now I still get a message about "unresolved external symbol _main" I assume this has to do with my use of int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) Is there another standard windows library that I need to link? The books make no mention of this, but linking the OpenGL libraries got rid of the unresolved symbols for the WGL calls... now what about that _main thing??? Edited by - blueboycurtis on October 19, 2001 6:10:22 AM

Share this post

Link to post
Share on other sites
I believe I can help you.

The problem is (I think) that you have create a console application. When you write a console application you must have a

void main()

function, not a WinMain. As I assume you want to write a window application, you must specify "Win32 Application" (NOT CONSOLE) when you create a new project then you can use the WinMain(...) fuction.

The other reason this could have happened is if you never created a Project and just made a .cpp file and hit build.

What I recomend you do is create a new Windows project copy your source files into the project directory then select to add them to you project (Maybe Tools->Add to project->Files... I can''t remember right now) then your ready, hit build and run your code

Good luck

PS: if you can''t understand my description email me at tom.oram@vizzavi.co.uk and I explain when I''m infront of a windows PC with MSVC++ on it and I can tell you the exact menu names you need to click

Share this post

Link to post
Share on other sites
I understand... thanks. I actually did not specify a project -- just went ahead and made a CPP, so it didn''t know which types of libraries to use I guess. There is a way to manually set all this stuff, but looks like the easiest route is to use a project to have everything set up (I haven''t used VC++ in years, so I am getting used to this)

Thanks! This forum is great!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!