New to C++ on Linux

T

Teddy

I have installed GNU C/C++ on my Linux and tried to compile my first
helloworld program. I tried this with the command:

cc helloworld.cpp -c -o helloworld.o && ld helloworld.o -lstdc++ -o
helloworld

And got the Error:

ld: warning: cannot find entry symbol _start; defaulting to 08048380

The program was created but does not work. What did I do wrong?
The source of my helloworld-program you can find at the end.

Thanks
Teddy



#include <iostream>

using std::cout;
using std::endl;

int main() {

cout << "Hello World" << endl;

return 0;
}
 
L

Lars Magne Engedal

Hi, I'm not sure what's wrong, but you could try this command:

c++ -o helloworld helloworld.cpp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top