public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: dlr13@mac.com
To: gcc-help@gcc.gnu.org
Subject: linking qsort with gfortran
Date: Sat, 22 Dec 2012 00:58:00 -0000	[thread overview]
Message-ID: <CE7946E5-B513-4380-B3C6-5BA2ED002FC9@mac.com> (raw)

First, apologies if this question has been answered elsewhere or I am doing something really stupid.  I have searched for several hours for a solution to my problem with no success.

I am trying to do a GCC build of a mix of C and Fortran source that has been successfully compiled for many years with both the PGI and Intel compilers. I have one Fortran routine that calls "qsort", a sorting routine provided in most libraries. I know it is provided in the GCC libraries. However, because the call is from Fortran code, it will properly link with the library and I get this error:

Undefined symbols for architecture x86_64:
  "_qsort_", referenced from:

I understand that the trailing underscore is the problem, but I cannot use the "no-underscoring" compiler flags because the code also links to other libraries that do provide the underscore which then breaks everything else.  I am using gfortran to do the linking though I get the same error with gcc.  I am using version 4.8 currently but get the same error with 4.7. Everything is on OS X, 10.7.

Any help would be greatly appreciated.  Thank you.

_____
David




             reply	other threads:[~2012-12-22  0:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-22  0:58 dlr13 [this message]
2012-12-22 12:15 ` Tim Prince
2012-12-22 14:43 ` Ángel González

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=CE7946E5-B513-4380-B3C6-5BA2ED002FC9@mac.com \
    --to=dlr13@mac.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).