473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

statically compiling

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.
Jan 18 '07 #1
2 4731
On Jan 18, 11:23 am, fangee <fangee80NOSPA...@gmail.comwrote:
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

Jan 18 '07 #2
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
Jan 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Schraalhans Keukenmeester | last post by:
I have successfully linked php statically to Apache 1.3.xx (on SuSE9.2) I used the --with-apache option which gave me a directory under the apache install tree where the includable files sit. ...
5
by: csnerd | last post by:
I have a really simple question. What is the difference between allocating memory following way: #1 int main(int argc,char* argv) { char str)+1]; return 0; }
12
by: Samee Zahur | last post by:
Back in the days of old C, only numeric literals could be used as dimensions for statically allocated arrays - the size had to be resolved to a constant at/before compile time. Now I'm beginning to...
4
by: RobG | last post by:
I have a function whose parameter is a reference the element that called it: function someFunction(el) { ... } The function is assigned to the onclick event of some elements in the HTML...
7
by: Lee Crabtree | last post by:
I'm starting work on what will eventually be a very, very LARGE project. A lot of the project involves taking C/C++ class libraries and wrapping them with managed C++. I'd like to minimize the...
3
by: Ralph Butler | last post by:
Hi: I have searched the docs and google but have not totally figured out how to accomplish my task: On a linux box, I want to compile and link python so that it uses no shared libraries, but...
19
by: DarelRex | last post by:
Is it possible to pass a 2-D, statically defined array? Here's a 1-D example that won't work: void foo() { int myArray ; bar(myArray); } void bar(int *arr) {
36
by: Martin Larsen | last post by:
Hi, When a PHP program links to a library using include or require (or their _once variations), is the library then linked dynamically or statically? While it might seem irrelevant from a...
8
by: Gilles Ganault | last post by:
Hello I need to compile PHP5 with SQLite statically and without PDO. I don't need DB-independence, so it's fine using sqlite_*() functions instead of PDO. 1. I've downloaded, compiled, and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.