Undefined __istype character with / opt / local / bin / g ++?

When I compile my program with this:

g++ -std=c++11 main.cpp -o run 

I get this error (not sure, since I am not using code c in it __istype):

Undefined symbols for architecture x86_64:
  "__istype(int, unsigned long)", referenced from:
      std::ctype<char>::is(unsigned long, char) const in ccuyHAvU.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

I searched and can not find the answer. It was suggested to include the full path to libstdc++.a, but did nothing:

g++ -std=c++11 main.cpp -o run /opt/local/lib/gcc48/libstdc++.a

But, when I compile with clang++on my machine, the program compiles and works.

For this particular project I have to use g++(servers do not have clang ++, but have g ++ v4.8). Is there anything I can do?

Edit: I tried which g++to see where my installation is g++. Then I ran the command /opt/local/bin/g++ -std=c++11 main.cpp -o run, but it also ends with the same message.

+4

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


All Articles