* fortran/ada/c code linking issues
@ 2005-09-28 17:18 Brett Grant
2005-09-28 17:55 ` Ishwar Rattan
0 siblings, 1 reply; 2+ messages in thread
From: Brett Grant @ 2005-09-28 17:18 UTC (permalink / raw)
To: gcc-help
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: fortran/ada/c code linking issues
2005-09-28 17:18 fortran/ada/c code linking issues Brett Grant
@ 2005-09-28 17:55 ` Ishwar Rattan
0 siblings, 0 replies; 2+ messages in thread
From: Ishwar Rattan @ 2005-09-28 17:55 UTC (permalink / raw)
To: gcc-help
On Wed, 28 Sep 2005, Brett Grant wrote:
> 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
>
Maybe you have non-shared object on Solaris for gnatlibrary and not
on other systems. Static flag implies that .a version of
library exists for linking.
-ishwar
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-28 17:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-28 17:18 fortran/ada/c code linking issues Brett Grant
2005-09-28 17:55 ` Ishwar Rattan
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).