* gcc34 and older libraries
@ 2004-06-04 6:46 Шебеко Евгений
2004-06-04 9:31 ` Claudio Bley
2004-06-04 11:23 ` Eljay Love-Jensen
0 siblings, 2 replies; 3+ messages in thread
From: Шебеко Евгений @ 2004-06-04 6:46 UTC (permalink / raw)
To: gcc-help
Hi, i compile my program using gcc34.
But I need to use libraries compiled using gcc-2.95
Is it possible?
I need use libraries compiled on older compiler, because
on FreeBSD gcc34 installed around of native compiler.(gcc-2.95)
Log with key -v.
g++34 -v -pthread -o httpts httpts.o htp_protocol.o /home/shebeko/Jheck/shared/pokrpak/pack.o \
/home/shebeko/Jheck/shared/libpokr/libpokr.a\
-L/usr/local/lib -lstdc++ -lACE
Reading specs from /usr/local/lib/gcc/i386-portbld-freebsd4.9/3.4.0/specs
Configured with: ./..//gcc-3.4-20040414/configure --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --program-suffix=34 --with-gxx-include-dir=/usr/local/lib/gcc/i386-portbld-freebsd4.9/3.4.0/include/c++/ --disable-shared --disable-libgcj --prefix=/usr/local i386-portbld-freebsd4.9
Thread model: posix
gcc version 3.4.0 20040414 (prerelease) [FreeBSD]
/usr/local/libexec/gcc/i386-portbld-freebsd4.9/3.4.0/collect2 -V -dynamic-linker /usr/libexec/ld-elf.so.1 -o httpts /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc/i386-portbld-freebsd4.9/3.4.0/crtbegin.o -L/usr/local/lib -L/usr/local/lib/gcc/i386-portbld-freebsd4.9/3.4.0 -L/usr/local/lib/gcc/i386-portbld-freebsd4.9/3.4.0/../../.. httpts.o htp_protocol.o /home/shebeko/Jheck/shared/pokrpak/pack.o /home/shebeko/Jheck/shared/libpokr/libpokr.a -lstdc++ -lACE -lstdc++ -lm -lgcc -lc_r -lgcc /usr/local/lib/gcc/i386-portbld-freebsd4.9/3.4.0/crtend.o /usr/lib/crtn.o
/usr/local/lib/libACE.so: warning: mktemp() possibly used unsafely; consider using mkstemp()
httpts.o: In function `server::server(char const*, int, ACE_Reactor*)':
httpts.o(.text+0x13): undefined reference to `ACE_Event_Handler::ACE_Event_Handler(ACE_Reactor*, int)'
httpts.o(.text+0x40): undefined reference to `ACE_UNIX_Addr::ACE_UNIX_Addr()'
httpts.o(.text+0x54): undefined reference to `ACE_INET_Addr::ACE_INET_Addr()'
httpts.o(.text+0x68): undefined reference to `ACE_SOCK_Acceptor::ACE_SOCK_Acceptor()'
... and many other undefined
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gcc34 and older libraries
2004-06-04 6:46 gcc34 and older libraries Шебеко Евгений
@ 2004-06-04 9:31 ` Claudio Bley
2004-06-04 11:23 ` Eljay Love-Jensen
1 sibling, 0 replies; 3+ messages in thread
From: Claudio Bley @ 2004-06-04 9:31 UTC (permalink / raw)
To: gcc-help
Hello Yevgeni (or is it Shebeko?).
On Fri, Jun 04, 2004 at 09:46:21AM +0300, ?????? ??????? wrote:
>
> Hi, i compile my program using gcc34.
> But I need to use libraries compiled using gcc-2.95
> Is it possible?
Nope, it isn't possible (regarding C++; C libraries should
work fine).
> I need use libraries compiled on older compiler, because
> on FreeBSD gcc34 installed around of native compiler.(gcc-2.95)
You'd need to recompile all the C++ libraries with the new compiler
in order to use them with your g++ 3.4 compiled programs.
Cheers.
--
Claudio
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gcc34 and older libraries
2004-06-04 6:46 gcc34 and older libraries Шебеко Евгений
2004-06-04 9:31 ` Claudio Bley
@ 2004-06-04 11:23 ` Eljay Love-Jensen
1 sibling, 0 replies; 3+ messages in thread
From: Eljay Love-Jensen @ 2004-06-04 11:23 UTC (permalink / raw)
To: Øåáåêî
Åâãåíèé,
gcc-help
Hi,
>Is it possible?
Short answer: no, it is not possible to use GCC 2.95 C++ libraries with
GCC 3.x compiled C++ code.
Long answer: yes, it is possible. But you don't want to do it.
To make it possible requires making a C thunk layer which interfaces to the
GCC 2.95 C++ libraries (compiled with GCC 2.95, obviously), then link
against the C thunk libraries with GCC 3.x.
If you want the C thunk libraries to behave "C++ ish", you'll need to write
a C++ wrapper over the C thunk library, which your wrappers and your C++
code compiled with GCC 3.x uses.
You'll have to handle each exception with kid's gloves, since exceptions
cannot propagate over a C barrier (they couldn't propagate anyway, since
the GCC 2.95 C++ ABIs are different from the GCC 3.x C++ ABI). You'll need
to catch them in your GCC 2.95 C thunk layer, serialize them to your C++
wrapper which then can reconstitute them in your GCC 3.x world.
Note: GCC 3.x C++ ABIs have some differences as well. I think 3.0.x is
one ABI, 3.1.x is another, 3.2.x-3.4.x is yet another. If I remember
correctly. It's documented somewhere.
Also, RTTI and dynamic casting will have issues as well. You'll need to
treat them with kids gloves as well.
And if you do things JUST right, you'll also get to shoot yourself in the
foot by having different heap managers involved. *laugh*
You may say, "Yikes, that's a lot of work! No one would do that!"
In my job, I do it all the time. And it is a lot of work. I wouldn't wish
it on anyone.
--Eljay
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-04 11:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-04 6:46 gcc34 and older libraries Шебеко Евгений
2004-06-04 9:31 ` Claudio Bley
2004-06-04 11:23 ` Eljay Love-Jensen
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).