Hi everybody,
I'm facing a problem trying to statically compile a simple c++ prog,
something like:
int main(){
return 1;
}
Using g++ 2.95.4 (I must use this to compile a much more complex
program) this way I get the following output:
$ g++ -static tmp.cpp
/usr/bin/../lib/libc.a(syslog.o): In function `__vsyslog_chk':
(.text+0x6dd): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(syslog.o): In function `__vsyslog_chk':
(.text+0x6f2): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(syslog.o): In function `openlog':
(.text+0x803): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(syslog.o): In function `closelog':
(.text+0x874): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(syslog.o):(.eh_frame+0x12): undefined
reference to `__gcc_personality_v0'
/usr/bin/../lib/libc.a(backtrace.o): In function `backtrace':
(.text+0x54): undefined reference to `_Unwind_Backtrace'
/usr/bin/../lib/libc.a(backtrace.o): In function `backtrace_helper':
(.text+0x10a): undefined reference to `_Unwind_GetIP'
/usr/bin/../lib/libc.a(backtrace.o): In function `backtrace_helper':
(.text+0x12f): undefined reference to `_Unwind_GetGR'
/usr/bin/../lib/libc.a(backtrace.o): In function `backtrace_helper':
(.text+0x13a): undefined reference to `_Unwind_GetCFA'
/usr/bin/../lib/libc.a(iofclose.o):(.eh_frame+0x11): undefined
reference to `__gcc_personality_v0'
/usr/bin/../lib/libc.a(iofflush.o): In function `fflush':
(.text+0xdc): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(iofflush.o):(.eh_frame+0x12): undefined
reference to `__gcc_personality_v0'
/usr/bin/../lib/libc.a(iofwrite.o): In function `fwrite':
(.text+0x126): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(iofwrite.o):(.eh_frame+0x12): undefined
reference to `__gcc_personality_v0'
/usr/bin/../lib/libc.a(wfileops.o): In function `_IO_wfile_underflow':
(.text+0x125d): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(wfileops.o):(.eh_frame+0x12): undefined
reference to `__gcc_personality_v0'
/usr/bin/../lib/libc.a(fileops.o): In function `_IO_file_fopen':
(.text+0x1f13): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(fileops.o): In function `_IO_file_underflow':
(.text+0x2108): undefined reference to `_Unwind_Resume'
/usr/bin/../lib/libc.a(fileops.o):(.eh_frame+0x12): undefined
reference to `__gcc_personality_v0'
collect2: ld returned 1 exit status
Statically compiling the same program with g++ 4.1.2 all works fine.
On my system (ubuntu linux 6.10 kernel 2.6.17-10-386) I've got the
following libstdc++:
/usr/lib/libstdc++-3-libc6.2-2-2.10.0.a
/usr/lib/libstdc++-3-libc6.2-2-2.10.0.so
/usr/lib/libstdc++.so.5.0.7
/usr/lib/libstdc++.so.6.0.8
Any suggestion?
Thanks,
f.