Linking to shared Library

Linking to shared Library

Post by Yani » Mon, 28 Apr 2003 18:15:04



hi,
is it possible to compile my appliction using gcc on AIX.
and try to link to a shared library that compile and link
with xlc(visual age) ??
(i am getting undefined symbols errors when i try to do that)

thanks
Yaniv

 
 
 

Linking to shared Library

Post by Paul Pluzhniko » Tue, 29 Apr 2003 01:05:23



> is it possible to compile my appliction using gcc on AIX.
> and try to link to a shared library that compile and link
> with xlc(visual age) ??

Yes, provided the library does not have any C++ in it.

Quote:> (i am getting undefined symbols errors when i try to do that)

What symbols? What is the error message?

Cheers,
--
In order to understand recursion you must first understand recursion.

 
 
 

Linking to shared Library

Post by Olaf Rogalsk » Tue, 29 Apr 2003 19:23:08



> hi,
> is it possible to compile my appliction using gcc on AIX.
> and try to link to a shared library that compile and link
> with xlc(visual age) ??
> (i am getting undefined symbols errors when i try to do that)

> thanks
> Yaniv

C++ won't work, but standard C is possible. Propably you need to
link your application against libgcc.a, which is distributed along
with gcc.

--
+----------------------------------------------------------------------+
I Dr. Olaf Rogalsky                         Institut f. Theo. Physik I I
I Tel.: 09131 8528440                       Univ. Erlangen-Nuernberg   I
I Fax.: 09131 8528444                       Staudtstrasse 7 B3         I

+----------------------------------------------------------------------+

 
 
 

1. Question: Inclusion of shared libraries during linking of shared libraries

Hi,

I am compiling a dynamic loadable library (*.so) under Unix (I'm working
under Solaris, but I guess my question applies to other Unix versions also).
This library requires other .so libraries to function. Now there are 2 ways
I can deal with this:

1.    Include the header files of the included library during compilation.
Do _not_ include the included library during linking, or
2.    Include the header files of the included library during compilation,
_and_ include the included library during linking.

Both of these work. When doing ldd on the 1st and the 2nd approach, I can
see that in the 2nd case the included libraries are required.

Can anyone tell me the pros and cons of either method? What is the preferred
way of doing this?

--
Pieter Winter
C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-IAQ: http://www.plethora.net/~seebs/faqs/c-iaq.html

2. MicroSpeed 3 button mouse

3. static linking of shared libraries

4. Swedish Government Study Endorses Open Source

5. Problem linking to shared library

6. setfacl question

7. linking against shared libraries

8. NMI watchdog generating NMIs every ~2 minutes??

9. Linking a shared library with an application into one file

10. How to code/link SVR4 shared library init routines?

11. Program hangs when linked without shared libraries

12. : linking with shared libraries...

13. _init and linking to shared libraries