pc_magas έγραψε:Tι gcc τι g++ απλά ο gcc με τις ειλογές του θεωρείτε ο top
Δεν είναι διαφορετικό το gcc από το g++; Απ'ό,τι ξέρω, μπορείς να φτιάξεις C/C++ με το g++ αλλά μόνο C με το gcc.
$ cat hello.cpp
#include <iostream>
int
main ()
{
std::cout << "Hello, world!\n";
return 0;
}
$
$ gcc hello.cpp
/tmp/ccIGYR5R.o: In function `main':
hello.cpp:(.text+0xa): undefined reference to `std::cout'
hello.cpp:(.text+0xf): 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/ccIGYR5R.o: In function `__static_initialization_and_destruction_0(int, int)':
hello.cpp:(.text+0x3d): undefined reference to `std::ios_base::Init::Init()'
hello.cpp:(.text+0x42): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccIGYR5R.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
$
$ g++ -Wall hello.cpp
$