Help in VC++ 6!

Started by
6 comments, last by jedis1000 20 years, 6 months ago
I got Visual C++ 6 installed on my machine and I was really psyked out. I wanted to start to write a program to the pythagorean theorum. First of all though, I wanted to test everything and see if it all worked. So I wrote a little test program which goes as follows: #include "stdio.h" #include "iostream.h" int main() { cout<<"Hello, World!"<<endl; return 0; } When I try to compile it, Visual C++ always says that there are 2 errors in it. I really don''t see any! And if there is a debug mode, can someone please tell me how to activate it? Because all I see is a bar at the bottom that says debug and theres nothing in it when I have any errors. So, in conclusion, What the hell is going on?
Advertisement
#include <iostream>


and the same for stdio but why are you using it?

and it should be cout << "Hello World!";

[edited by - kordova on October 14, 2003 7:09:35 PM]
Ok, heres the updated code:

#include <iostream>
#include <stdlib>

int main()
{

cout << "Hello World!";

return 0;
}

I added the stdlib file and found that it narrowed everything down to one error. I also fixed everything else. (I hope)
I still have 1 error left to kill though. Can someone please help me?
using namespace std;
under the #includes
Just a hint: Actually read the errors. If they seem like nonesense, read them anyway, so that eventually you can see which error means what. And if you did read them, it helps to post theme here. Also, including stdio shouldn''t affect it at all...
-~-The Cow of Darkness-~-
What the heck?
I''ve tried just about everything there is to try with this damn thing.
Here is what it says inthe error box:

--------------------Configuration: Project_1 - Win32 Debug--------------------
Compiling...
Project_1.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Project_1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Project_1.exe - 2 error(s), 0 warning(s)



I don''t understand why it says all of this though. Below is the sourcecode that I used when I got this error:


#include <iostream>

using namespace std;
int main()
{

cout << "Hello World!";

return 0;
}




What the heck is going on? I linked all of my libraries, include files- just about everything. What is going on?
I FINALLY got it to work!
Thanks for all of your help and to everyone who gave advice throughout his whole 45 minute ordeal through hell. Now, I can get in to really programming some cool stuff.
-Thanks
You got it working but your problem was you were using main() in a win32 application which needs WinMain(). main() is used in console apps. I dont'' think you''re quite ready for win32 so stick to console apps for now eh? good luck dude
"The human mind is limited only by the bounds which we impose upon ourselves." -iNfuSeD

This topic is closed to new replies.

Advertisement