Autotools/libtool link library with libstdc++ despite -stdlib=libc++ option passed to configure

StackOverflow https://stackoverflow.com/questions/16248360

문제

I'm trying to build google-glog on Mac OS X 10.8, using following options:

./configure CXX='clang++' CXXFLAGS='-std=c++11 -stdlib=libc++'

Despite that the library gets linked with libstdc++.

Why, and how to fix this?

도움이 되었습니까?

해결책

It's better to put 'dialect' and runtime flags in the compiler variable, since it will use those flags for linking - not just source compilation: CXX="clang++ -std=c++11 -stdlib=libc++"

Save CXXFLAGS for things like -W -Wall -O2 -march=xxx, etc.

다른 팁

Found out that you could use the build variable

LIBS+="-stdlib=libc++"

Seems to me a better place than the compiler variables.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top