Do I need another library linked? unresolved external symbol _main

Started by
1 comment, last by blueboycurtis 22 years, 6 months ago
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
Advertisement
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
X2K

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
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!

This topic is closed to new replies.

Advertisement