全网首发:Undefined symbols for architecture x86_64: “std::__1::locale::use_facet(std::__1::locale::id&am

Posted 柳鲲鹏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了全网首发:Undefined symbols for architecture x86_64: “std::__1::locale::use_facet(std::__1::locale::id&am相关的知识,希望对你有一定的参考价值。

  • 吾是在MAC上编译OpenJDK8出的这个错误。而且这个错误是编译openjdk8u242时出现的。u252就没有这个错误。
  • gcc改为g++

试了无效果。

  • 增加-lstdc++

有时是必须的,有时不是。建议加上。

  • 具体错误:
Making adlc
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
Undefined symbols for architecture x86_64:
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) in filebuff.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in filebuff.o
  "std::__1::ios_base::getloc() const", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) in filebuff.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in filebuff.o
  "std::__1::ctype<char>::id", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) in filebuff.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in filebuff.o
  "std::__1::locale::~locale()", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) in filebuff.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in filebuff.o
  "std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::id", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) in filebuff.o
  "std::__1::ios_base::clear(unsigned int)", referenced from:
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int) in filebuff.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush() in filebuff.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry() in filebuff.o
      std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in filebuff.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[6]: *** [../generated/adfiles/adlc] Error 1
make[5]: *** [ad_stuff] Error 2
make[4]: *** [product] Error 2
make[3]: *** [generic_build2] Error 2
make[2]: *** [product] Error 2
make[1]: *** [/Users/taishansoft/Downloads/openjdk8-u242/jdk8u242/build/macosx-x86_64-normal-server-release/hotspot/_hotspot.timestamp] Error 2
make: *** [hotspot-only] Error 2
  • 解决办法

经过一番辛苦搜索学习,连蒙带猜,找到的解决办法竟然是:

# NEW_INCLUDE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1

NEW_INCLUDE=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1

export   CFLAGS="-I$NEW_INCLUDE"
export CXXFLAGS="-I$NEW_INCLUDE"

以上是关于全网首发:Undefined symbols for architecture x86_64: “std::__1::locale::use_facet(std::__1::locale::id&am的主要内容,如果未能解决你的问题,请参考以下文章

全网首发:终极解决办法:/usr/bin/ld: libcc.so: no symbol version section for versioned symbol `memcpy@GLIBC_2.0‘

ImportError: cython_lapack.so: undefined symbol: undefined symbol: ztpqrt2_

symbol lookup error *** , undefined symbol 错误

ImportError: cython_lapack.so: undefined symbol: undefined symbol: ztpqrt2_

全网首发:LINUX下载编译usbutils

全网首发:No package ‘usbutils‘ found