AAARRRGGGHHH!!!

Started by
16 comments, last by ace_muncher 22 years, 6 months ago
Have you made sure your project is a Win32 application?
Advertisement
Thanks for the psycological lesson.
Its not panicky, but fustrating.
Something so simple, yet so hard.....

Error message:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Windows.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

This program isn''t a WIN32 app, but my other programs are, and they say the exact same thing.

-Ace
-Ace
quote:Original post by pentium3id
I can''t belive the guy ask for help,
and you goofs discuss string probability !!

It''s actually a more interesting question. The point they''re implying is that a curosry check of the forums will reveal a ton of identical posts, that contain several suggestions on how to solve the problem. Why should we answer yet again what has been answered a few hundred times? The moral is "apply yourself and you''ll probably find your answer, without losing your ''dignity''."

quote:This is insane...

So is the question, sort of. Netiquette says to read through and see if someone has answered your question already. And using the title "argh!" (however many r''s and g''s you put in it) doesn''t help either, since those who probably could help wouldn''t be interested in a post with such a generic title.

Ignoring case sensitivity, I''d say the probability is about 0.45 (considering that it''s usually a newbie post.)
quote:Original post by ace_muncher
Thanks for the psycological lesson.
Its not panicky, but fustrating.
Something so simple, yet so hard.....

Error message:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Windows.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

This program isn''t a WIN32 app, but my other programs are, and they say the exact same thing.

-Ace


Sounds like your trying to compile a "Win32 Console Application".

Create a new project, and be sure to select "Win32 Windowed Application" (or is it simply "Win32 Application"). Then paste the little code-snippet you had into a .c/.cpp file in the project and compile. It should work (unless something else is also wrong of course ).
Hi,

I had a few probs with C++ too, however I solved it and I think this could be your prob.

For some weird reason I have to declare the iostream.h lib both in the .cpp program and the stdfx.cpp program as well otherwise nothing happens.

Also when starting a fresh program make sure it is a Win32 Console Application and that you choose A Simple Application from the other menu.

Doing it this way works for me with MS VC++, try it and see what happens, should work

Spritey
I thank those people who weren''t analyzing how many r''s and g''s that were in the title and trying to find my motive.
I will use all this advice given to me with great thanks. Thank you.

-Ace

PS Thank you. (j/k)
-Ace
quote:Original post by Sir_Spritely
For some weird reason I have to declare the iostream.h lib both in the .cpp program and the stdfx.cpp program as well otherwise nothing happens

That sounds extremely odd. Are you sure that that is what actually solved your problem? And what do you mean by "nothing happens"? Don''t you even get compiler/linker errors?

Generally you shouldn''t touch "stdafx.cpp", it''s main (and AFAIK only) purpose is to include "stdafx.h" (those files are usually used to generate a pre-compiled header file).
Also, since ace_muncher didn''t use anything from iostream in the example above, there should be no need for him to include the header to make it work (had something like a missing #include been the problem he would have gotten compiler errors, not linker errors).
quote:
Also when starting a fresh program make sure it is a Win32 Console Application and that you choose A Simple Application from the other menu.

For the little example ace_muncher gave above (the "Goodbye, cruel world" MessageBox) the project should *not* be a console application!
Hey,

Yeah that appeared to solve my problem. My progs in C++ will not compile unless I declare #include "iostream.h" in the stAfx.cpp file which is automatically created. I guess the compiler must be set up wrong or something then but I just installed it straight from the CD.

In terms of answering the poster of this threads question yeah since I am only upto Hour 13 Advanced functions in my sams teach yourself in 24 hrs book I will keep my mouth zipped until I know what I am on about

This topic is closed to new replies.

Advertisement