This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC 2.9 on AIX 5L V5.1


Hi Folks !

We switched from AIX 4.3.3 to AIX 5L V5.1. Unfortunately i am
basicly a Solaris developer ... Anyway ...

Now we want to use the gcc which comes with AIX. The following
output comes from the followong commands:

> type gcc: gcc is /usr/bin/gcc
> gcc --version: 2.9-aix51-020209
> oslevel -r: 5100-04

This for Info. Now to the problem.

I have a file called f.cpp which defines the function void f(void).
void f(void) calls foo(), which is defined in foo.cpp. And of course
a have main.cpp which defines main() and f() is called in main.

f.cpp shoul be provides as a static archiv named libf.a and foo.cpp
should be provided as a dynamic loadable shared object name libfoo.so.
In ohter words main() calls f() [in the statcic lib] and f() calls foo()
[in the dynamic shared lib].

Unfortunately i can not link main with my libriaries :-(

This is how i compile, link etc:

> gcc -c f.cpp
> ar -r libf.a f.o

> gcc -c -fpic foo.cpp
> gcc -fpic -shared
> gcc -fpic -shared -o libfoo.so foo.o -lstdc++ -lm

> gcc -c main.cpp

Now i try to link my main.o with the previous built libraries. This is
the point i am not sure how it should work. I tried:

> gcc -o main main.o -L. -lf -lfoo

Results in:

ld: 0706-006 Cannot find or open library file: -l foo
        ld:open(): No such file or directory
collect2: ld returned 255 exit status

and

> gcc -o main -brtl -L. -lf -lfoo

Results in:

ld: 0706-006 Cannot find or open library file: -l foo
        ld:open(): No such file or directory
ld: 0706-005 Cannot find or open file: libgcc.a
        ld:open(): No such file or directory
ld: 0706-005 Cannot find or open file: libgcc.a
        ld:open(): No such file or directory
gcc: file path prefix
`/opt/freeware/GNUPro/lib/gcc-lib/rtl/2.9-aix51-020209/' never used


PLEASE HELP !!! It is urgend for me to have this working today! What do i
miss ??

Thank you very much in advance

Helmut


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]