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

Chris Jones jonesc at hep.phy.cam.ac.uk
Thu Nov 7 13:18:30 PST 2013


Hi,

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

http://stackoverflow.com/questions/19649421/something-odd-happened-to-c-11-in-mavericks

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.

Chris

On 7 Nov 2013, at 10:00pm, Ryan Schmidt <ryandesign at macports.org> wrote:

> 
> On Nov 6, 2013, at 15:27, Brian D. McGrew wrote:
> 
>> I’m getting an undefined symbol for isalnum and isgraph using g++-mp-4.8.
> 
> By doing what, specifically?
> 
> I can attempt to reproduce the issue on my system for you, but I am not a C or C++ programmer, so assume I know nothing. What should I do to reproduce the issue? For example, you showed some code, but did not say what filename to save it into or what command to then run on the command line to produce the error message. I’ve tried a few things but I’ve received different error messages than you so I won’t bother mentioning what I tried and I’ll wait for you to tell me what I should try.
> 
> 
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2030 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20131107/4d79337f/attachment.p7s>


More information about the macports-users mailing list