fortran/ada/c code linking issues
Brett Grant
brettgrant99@yahoo.com
Wed Sep 28 17:18:00 GMT 2005
I have access to a number of different computer
systems. Some are Sun Sparc (Solaris 8), some are
Opterons (RHE 4), some are Mac PowerPC (OS X tiger).
All have slightly different versions of gcc, but all
of them are gcc 3.2 or higher, but none are higher
than 4.0.
I will admit that I know enough to get some stuff
done, but some of this stuff is a complete mystery to
me. Anyway, I have a program that is written in
fortran. It has some subroutines written in C and in
Ada. When I compile the program on the Suns, I must
include the flag '-static' in order to get it to
compile and link correctly. However, on the opterons
and macs, if I include the flag '-static', it will
compile, but not link. It says that it can't find
some gnat library:
/usr/bin/ld: cannot find -lgnat-3.4
collect2: ld returned 1 exit status
gnatlink: cannot call /usr/bin/gcc
If I don't give it the static flag, it links
correctly and ldd shows the gnat library. I don't
understand why in one instance it can find the shared
library, but not when I give it the static flag. Is
there some sort of different path search order when
-static is used. I couldn't find any in the
documentation. I also wonder if gcc is installed
correctly, maybe the libraires didn't end up in some
standard path?
Now I don't ask to link in libgnat-3.4.so.1 so this
must somehow be added in by the call to gnatlink. If
I include the static flag and -L/usr/lib, which is
where libgnat-3.4.so.1 is located, it still can't find
it. Now I am really confused.
The sys admins don't really understand this. I don't
really know enough to figure out how to troubleshoot
this. I guess that is what I am asking. How do I
figure out what is really going on?
Is there a better place to ask this question?
Thanks,
Brett Grant
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
More information about the Gcc-help
mailing list