* exceptions without libstdc++
@ 2000-06-12 0:13 Erik Smith
0 siblings, 0 replies; 2+ messages in thread
From: Erik Smith @ 2000-06-12 0:13 UTC (permalink / raw)
To: gcc
How do I compile a program with exceptions without linking in
libstdc++? I'm trying to reduce the size of my program by excluding the
standard library which I'm not using. I'm linking with the following options:
-nodefaultlibs -lc -lgcc
as soon as I have a throw I get the following link errors:
bench1cpp.o(.text+0x1c): undefined reference to `__eh_alloc'
bench1cpp.o(.text+0x31): undefined reference to `int type_info function'
bench1cpp.o(.text+0x38): undefined reference to `__cp_push_exception'
bench1cpp.o(.text+0x3d): undefined reference to `__throw'
bench1cpp.o(.text+0x53): undefined reference to `__throw'
bench1cpp.o(.text+0x61): undefined reference to `__start_cp_handler'
bench1cpp.o(.text+0x6c): undefined reference to `__cp_pop_exception'
bench1cpp.o(.text+0x78): undefined reference to `__throw'
bench1cpp.o(.text+0x85): undefined reference to `__cp_pop_exception'
bench1cpp.o(.text+0x93): undefined reference to `terminate(void)'
which library do I need?
erik
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: exceptions without libstdc++
@ 2000-06-12 15:29 Mike Stump
0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2000-06-12 15:29 UTC (permalink / raw)
To: ersmith, gcc
> Date: Mon, 12 Jun 2000 00:22:47 -0700
> To: gcc@gcc.gnu.org
> From: Erik Smith <ersmith@ucsd.edu>
> How do I compile a program with exceptions without linking in
> libstdc++? I'm trying to reduce the size of my program by excluding the
> standard library which I'm not using. I'm linking with the following options:
> -nodefaultlibs -lc -lgcc
> as soon as I have a throw I get the following link errors:
> bench1cpp.o(.text+0x1c): undefined reference to `__eh_alloc'
> bench1cpp.o(.text+0x31): undefined reference to `int type_info function'
> bench1cpp.o(.text+0x38): undefined reference to `__cp_push_exception'
> bench1cpp.o(.text+0x3d): undefined reference to `__throw'
> bench1cpp.o(.text+0x53): undefined reference to `__throw'
> bench1cpp.o(.text+0x61): undefined reference to `__start_cp_handler'
> bench1cpp.o(.text+0x6c): undefined reference to `__cp_pop_exception'
> bench1cpp.o(.text+0x78): undefined reference to `__throw'
> bench1cpp.o(.text+0x85): undefined reference to `__cp_pop_exception'
> bench1cpp.o(.text+0x93): undefined reference to `terminate(void)'
> which library do I need?
You're confused. Using a library doens't make your code bigger,
unless you use it. You cannot just remove the library on the link
line and make your code smaller. Stop using -nodefaultlibs, it
doesn't do what you think it does. Sorry. This list, is the wrong
place to learn about such topics.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-06-12 15:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-12 0:13 exceptions without libstdc++ Erik Smith
2000-06-12 15:29 Mike Stump
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).