create a shared library on AIX 4.3 with xlC

create a shared library on AIX 4.3 with xlC

Post by Thomas Rademache » Sat, 13 May 2000 04:00:00



Hallo AIX friends,
I want to compile on a AIX4.3 with xlC compiler and build a shared
library.
Compiling was ok. But when I start the makeC++SharedLib_r the following
error message comes:

 ...

Quote:>makeC++SharedLib_r -p 5000 -o libtest.a

test.o -lm -lpthreads_compat -lpthreads -L/usr/lpp/xlC/lib -lbsd
Quote:>halt 4
>savename a.out
>filelist 5 3
>i /test.o
>lib /usr/lib/libm.a
>lib /usr/lib/libpthreads_compat.a
>lib /usr/lib/libpthreads.a
>lib /usr/lib/libbsd.a
>exports /tmp/mcshl.tmpe.35046
>exports /tmp/ccAQ2mUa.x
>resolve
>addgl /usr/lib/glink.o
>er full
>mismatch
>comprld
>origin 0x0 0x0

<libpath /usr/lpp/xlC/lib:/usr/ibmcxx/lib:/usr/lib:/lib

Quote:>save 1L .
>rc
>collect2: a.out: can't open as COFF file

What the matter??

Do you need more information?
Thank you for your tips.
Greetings from Berlin
Thomas

Hallo AIX friends,
I want to compile on a AIX4.3 with xlC compiler and build a shared
library.
Compiling was ok. But when I start the makeC++SharedLib_r the following
error message comes:

 ...

Quote:>makeC++SharedLib_r -p 5000 -o libtest.a

test.o -lm -lpthreads_compat -lpthreads -L/usr/lpp/xlC/lib -lbsd

- Show quoted text -

Quote:>halt 4
>savename a.out
>filelist 5 3
>i /test.o
>lib /usr/lib/libm.a
>lib /usr/lib/libpthreads_compat.a
>lib /usr/lib/libpthreads.a
>lib /usr/lib/libbsd.a
>exports /tmp/mcshl.tmpe.35046
>exports /tmp/ccAQ2mUa.x
>resolve
>addgl /usr/lib/glink.o
>er full
>mismatch
>comprld
>origin 0x0 0x0

<libpath /usr/lpp/xlC/lib:/usr/ibmcxx/lib:/usr/lib:/lib

Quote:>save 1L .
>rc
>collect2: a.out: can't open as COFF file

What the matter??

Do you need more information?
Thank you for your tips.
Greetings from Berlin
Thomas

 
 
 

create a shared library on AIX 4.3 with xlC

Post by Mark Mende » Sat, 13 May 2000 04:00:00


collect2 is a GNU utility.  Which ld are you invoking?
--
Mark Mendell
Visual Age C++ Development
IBM Toronto Lab


 
 
 

1. How do you create shared libraries with gcc on AIX 4.3

Couldn't find a solution to my problem on deja archive. Is it
definitely dead or what?

I installed gcc 2.95.2 with --enabled-shared and --enable-pthreads.
I use the native linker and assembler.

When I compile with gcc -c and link the object files to produce my
shared library (with -bM:SRE -bnoentry -bE:<expfile>), the linker
complains the object files aren't in XCOFF format.

When I compile with gcc -shared and use the -Xlinker directive to
pass the same 3 binder options to the linker, I obtain messages
like this:
collect2: /home/me/project/file.o: not a COFF file

Some of the object/libraries I link with have been compiled with
the xlc compiler (vac 4 if that matter). Could that be my problem?

I have very little experience with the gcc compiler (let's say 2 days;-)
as well as with AIX object file formats. So if someone can help me
to get out of that mess, thanks, but please, do assume I'm more stupid
than you (which is probably the case) and don't hesitate to give details.

Thanks in advance,

Jacques Vidal

2. export variables to calling shell in a shell-script

3. runtime error 0509-151, shared libraries, AIX 4.3, etc.

4. ANNOUNCEMENT: Free sw for c/s printing

5. Shared library problem and AIX 4.3

6. S3 Trio64 V2/DX

7. create a shared library on AIX4.3 with xlC Compiler

8. A Question About Fetchmail

9. Differences between the xlC 3.1.4 and 3.6.4 compilers on AIX 4.3

10. Differences between xlC v3.1.4 and 3.6.4 on AIX 4.3

11. IBM C++ 3.6.6 (xlC) Compiler error on AIX 4.3

12. Store Procedure Builder hangs (AIX 4.3, DB2 v.7.1, XLC)

13. linking with a shared library using xlC on Aix 5.1