gcc48/gcc49: isalnum/isgraph: Undefined symbols for architecture x86_64

Brian D. McGrew brian at visionpro.com
Thu Nov 7 13:30:04 PST 2013

On 11/7/13, 2:18 PM, "Chris Jones" <jonesc at hep.phy.cam.ac.uk> wrote:

>Brian¹s example was incomplete and won¹t compile for other reasons, thats
>probably what you are seeing (no main{..} and a missing ;}.
>The easiest is to look at
>I can reproduce the issue as per there. i.e.
>pb-d-128-141-128-171 ~ > cat test.cpp
>#include <cctype>
>int main() {
>  std::isalnum('c');
>  return 0;
>pb-d-128-141-128-171 ~ > g++-mp-4.8 test.cpp
>pb-d-128-141-128-171 ~ > g++-mp-4.8 -std=c++11 test.cpp
>Undefined symbols for architecture x86_64:
>  "isalnum(int)", referenced from:
>      _main in ccNvkS6f.o
>ld: symbol(s) not found for architecture x86_64
>collect2: error: ld returned 1 exit status
>pb-d-128-141-128-171 ~ > clang++ -std=c++11 test.cpp
>pb-d-128-141-128-171 ~ >
>My guess is this is just another facet of the libstdc++ versus libc++
>runtime saga, and the removal of libstdc++ in OSX 10.9. Enabling c++11
>support is expected to make this issue more pronounced, as I understand
>it, to my limit knowledge.

You are correct on all accounts, I did have a typo in my example (DOH!!!),
if I drop the -std=c++11 it works and if I compile with clang++ it works
as well.

Anyone have a suggestion for a proper workaround???


More information about the macports-users mailing list