Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 745
rincewind Avatar asked Apr 27 '13 04:04

rincewind


1 Answers

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.

like image 118
Brett Hale Avatar answered Nov 14 '22 12:11

Brett Hale