From: Brett Grant <brettgrant99@yahoo.com>
To: gcc-help@gcc.gnu.org
Subject: fortran/ada/c code linking issues
Date: Wed, 28 Sep 2005 17:18:00 -0000 [thread overview]
Message-ID: <20050928171747.36140.qmail@web40429.mail.yahoo.com> (raw)
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
next reply other threads:[~2005-09-28 17:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-28 17:18 Brett Grant [this message]
2005-09-28 17:55 ` Ishwar Rattan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050928171747.36140.qmail@web40429.mail.yahoo.com \
--to=brettgrant99@yahoo.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).