How to compile and link with MacPort libstdc ++ in Xcode?

I just updated my gcc distribution via MacPorts and I would like to use the latest libstdC ++ 4.7 (which supports several C ++ 11 functions that interest me) with Xcode clang ++. Obviously, activating the new gcc4.7 using the MacPorts select command is not enough, as Xcode continues to complain about missing headers, for example.

 #include<random> 'random' file not found 

I already installed an additional header directory (Macroorts by default root /opt/local/include ) and an additional library directory (MacPorts default root /opt/local/lib ), however, it seems that Xcode hardly recognizes that its headers are in C + + in /opt/local/include/gcc47/c++ .

+4
source share

Source: https://habr.com/ru/post/1439525/


All Articles