Results 1 to 5 of 5
hi..
im working on a socket API application that simulates concurrent server using fork()..anyway im trying to compile it using plain old gcc compiler:
Code:
gcc concFork.cpp -o conc
and ...
- 03-25-2008 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 60
error in socket based application
hi..
im working on a socket API application that simulates concurrent server using fork()..anyway im trying to compile it using plain old gcc compiler:
and this is the error im getting:Code:gcc concFork.cpp -o conc
any idea what the problem might be?Code:/tmp/ccm3Et4Z.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
- 03-25-2008 #2Just Joined!
- Join Date
- Oct 2007
- Posts
- 60
hello again
i tried something different..i thought the problem was one of the socket library functions but it wasnt..
i tried the following program:
and the same error came out...so its something that has nothing to do with the sokcet library..so any ideas?Code:#include <stdio.h> int main() { printf("print something\n"); return 0; }
- 03-25-2008 #3
Instead of the gcc command, try the g++ command.
--
Bill
Old age and treachery will overcome youth and skill.
- 03-26-2008 #4Just Joined!
- Join Date
- Oct 2007
- Posts
- 60
ya g++ worked..thanx..do u mean gcc is a C compiler and g++ is a cpp compiler?..
- 03-26-2008 #5
No. I tried your second program (the simple one) in a file with a .cpp extension using the gcc command, and the program ran without problems. The reason that I suggested using the g++ command is that I've seen people with a similar problem, and the suggestion came up to use g++, and it seemed to fix their problem (this problem that I apparently don't have).
The gcc command typically runs a compiler, an assembler, and a linking loader. It's supposed to recognize from the extension (in this case, .cpp) whether the program is, say, C or C++. Based on that, it should cause the appropriate stuff (lots of it, much of which I don't understand) to happen.
What's failing in your case is that each normal free-standing application (like your second program, the simple one) can't run with just the code you provide. There needs to be some preliminary setup before main() is called. This is previously compiled code which is installed with your C/C++ compilation stuff. There is one for C, and another for C++. My guess is that the linking loader loaded the wrong one, and failed because the proper external symbol was missing.
Again, I didn't have this problem, and it could be a problem with how the C/C++ compilation stuff is configured/installed for your system.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote