Archived

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

ace_muncher

AAARRRGGGHHH!!!

Recommended Posts

I can''t get Microsoft Visual C++ 6.0 to program in Windows. I have tried copying character for character from books, copied source code that works elsewhere, etc. It will not work for me. Can anyone tell me if they think I''m doing something totally idiotic? Is it the preferences of MSVC 6.0? Teach me now, laugh later, then I''ll laugh with you. -Ace

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Here is an example of a program copied character for character:


#include

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
return 0;
}


I don''t know what most of it means yet, so don''t ask.

-Ace

Share this post


Link to post
Share on other sites
What is the probability that if someone uses ARGH! as the title 500 times on gamedev.net, sometimes with more A''s or more !''s, etc, that two will be the same?



Just a thought.

"He who fights with monsters should look to it that he himself does not become a monster... when you gaze long into the abyss, the abyss also gazes into you..."~Friedrich Nietzsche

Share this post


Link to post
Share on other sites
i''m not sure about the probability, but if you look at this interesting example of the word, you will find that each letter is repeated three times. This indicates that when ace_muncher was typing the title, he/she was typing it with deliberation as opposed to with panic, indicating that the situation may not at all be that serious.

a2k

Share this post


Link to post
Share on other sites
True.

I think when someone is panicing they tend to hold down the last few letters longer than the first.

Maybe if we said 300 of those people were panicing and 200 were calm but a bit frustrated.. would that help at all?

"He who fights with monsters should look to it that he himself does not become a monster... when you gaze long into the abyss, the abyss also gazes into you..."~Friedrich Nietzsche

Share this post


Link to post
Share on other sites
you mean in hypothesizing a viable probability of the occurrence of those letters being the same twice? hmm... it depends. are you considering case sensitivity?

a2k

Share this post


Link to post
Share on other sites
I can''t belive the guy ask for help,
and you goofs discuss string probability !!

This is insane...

Hugo Ferreira
UniteK Future
"Concentrate, and you can see it. If you see it, then it is possible. If it is possible, you can Achieve it."

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hey, look at the forth post in the "C++ or VB" topic by anderstar in this forum... it has a very loooooong "argh" in it...

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites