Hi guys
I installed mint today, and I made a hello world program in c++. I would like to compile it.
I installed all of the things (build essential, g++, etc...) and when I try to compile it it gives me various errors:
Here is the code I would like to compile:
It is saved as helloworld.cpp, and I am compiling it with this command: gcc helloworld.cpp -o helloworld
And I get this error:
Could someone help me solve this issue? Thanks
I installed mint today, and I made a hello world program in c++. I would like to compile it.
I installed all of the things (build essential, g++, etc...) and when I try to compile it it gives me various errors:
Here is the code I would like to compile:
Code
#include <iostream>
using namespace std;
int main() {
cout << "Hello world";
return 0;
}It is saved as helloworld.cpp, and I am compiling it with this command: gcc helloworld.cpp -o helloworld
And I get this error:
Code
/tmp/ccssFjje.o: In function `main':
helloworld.cpp:(.text+0x14): undefined reference to `std::cout'
helloworld.cpp:(.text+0x19): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccssFjje.o: In function `__static_initialization_and_destruction_0(int, int)':
helloworld.cpp:(.text+0x41): undefined reference to `std::ios_base::Init::Init()'
helloworld.cpp:(.text+0x58): undefined reference to `std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit statusCould someone help me solve this issue? Thanks
