Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > statically compiling

Reply
Thread Tools

statically compiling

 
 
fangee
Guest
Posts: n/a
 
      01-18-2007
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+0x210: 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.
 
Reply With Quote
 
 
 
 
=?iso-8859-1?q?Erik_Wikstr=F6m?=
Guest
Posts: n/a
 
      01-18-2007
On Jan 18, 11:23 am, fangee <(E-Mail Removed)> wrote:
> 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'

[snip]
> collect2: ld returned 1 exit status
>
> Statically compiling the same program with g++ 4.1.2 all works fine.


Well, either you are not trying to compile the code given above, or you
have some problem with your compiler, in which case you should turn to
a newsgroup dedicated to that subject (gnu.g++.help).

--
Erik Wikström

 
Reply With Quote
 
 
 
 
Lionel B
Guest
Posts: n/a
 
      01-18-2007
On Thu, 18 Jan 2007 10:23:51 +0000, fangee wrote:

> 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':


[snip more errors]

> Statically compiling the same program with g++ 4.1.2 all works fine.


[snip]

You must be aware that g++ 2.95.x is pretty ancient and not terribly
standards-compliant. That said, it looks as if the problem may be with
your gcc 2.95.4 compiler setup and hence off-topic here (the C++ *code* is
valid); I'd suggest asking on a newsgroup for your compiler/OS.

Regards,

--
Lionel B
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Cross-compiling error when compiling 2.6.1... Garrett Cooper Python 0 02-24-2009 09:47 PM
Cross-compiling error when compiling 2.6.1... Garrett Cooper Python 0 02-24-2009 08:55 PM
is Java dynamically or statically typed language or both? puzzlecracker Java 9 12-30-2005 08:26 PM
Compiling when libedit is in path Is there a trick to compiling Ruby when libedit must exist in the search path? Can you statically link to readline 5.0 in some manner? -- Lon Baker Lon Baker Ruby 1 03-21-2005 08:57 AM
why are overloaded methods statically bound? sticky@texas.net Java 17 11-03-2003 07:33 PM



Advertisments