What's the different between gcc and g++ ?
hi, what's the different between
gcc -std=c++98 and g++ ? Files Test.cpp Code:
#include <stdio.h> g++ Test.cpp it's fined but when I compiled with gcc -std=c++98 Test.cpp or gcc Test.cpp it's error and print [quote] /tmp/ccmerMxh.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status [/qoute] why is that ? |
From the gcc manual page:
Quote:
|
That's still doesn't answer my question.
I mean what's the different between : g++ and gcc -std=c++98 when I compile with the code of my first post. g++ compiled fine. but gcc -std=c++98 produce error as I stated before. why is it like that ? the code is standard C, if I am not wrong. I want to try to compile if standard c library is work in c++ (g++ and gcc -std=c++98). it worked in g++ but why it didn't work on gcc -std=c++98 ? |
Note that the error says ld returned 1 exit status, so it is not gcc that makes the error, but rather ld that does not find the reference to __gxx_personality_v0, at least that is how I understand it
A quick google search shows me that __gxx_personality_v0 is defined by the libstdc++.so library Maybe this will work: gcc -std=c++98 -lstdc++ Test.cpp |
Quote:
__gxx_personality_v0 is related to C++ exceptions and I would surmise the compiler is getting confused due to the file extension. Instead try compiling the code with "gcc -x c Test.cpp" which overrides the file extension. |
All times are GMT -5. The time now is 02:21 AM. |