Web Hosting Talk







View Full Version : simple C++ Question


epgs
08-19-2002, 06:25 PM
Simple C++ Question
I am just learning C++
I am getting the error
Link Error: Unidentified Symbol: _WinCRTStartup in module entry pont

here is my code




[QUOTE]

#include <iostream>

using namespace std;

int main()

{

cout << "Hello World" << endl;
return 0;

}

{/Quote]

The code is right, what is wrong?

archie2
08-19-2002, 06:28 PM
could be iostream.h
8th computer classes sure come in handy :)

epgs
08-19-2002, 06:30 PM
no still same problem

epgs
08-19-2002, 06:31 PM
i am using code warrior 7.0

RobTheGolfer
08-19-2002, 06:52 PM
#include <iostream.h>

int main()
{

cout << "Hello World" << endl;

return 0;
}

That should work fine. :D

epgs
08-19-2002, 07:26 PM
no same problem

MoSupaFly
08-19-2002, 07:38 PM
Honestly I don't see anything wrong with your code at all. Your version or the one that Rob provided should work without problems. The error your getting is coming from the linker not being able to resolve the _WinCRTStartup symbol, which I have no clue what that's all about.

I'm not familiar with the compiler you're using so I can only give you general things to look for/try. I'm assuming you're trying to compile your program from within the IDE, right? Perhaps you've got another file associated with that project that you don't realize is there? Make sure your .cpp file is the only one being compiled and that there aren't any other files associated with your project (well except for iostream as you'll need that for cout). If anything... try compiling from the command line. Otherwise... I'm not sure what else to tell you at this moment.

RobTheGolfer
08-19-2002, 07:38 PM
Then the compiler is having problems. Try usign a different compiler such as Microsoft's Visual C++.