Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using libc++ instead of libstdc++ in Qt Creator

I have clang++ 3.5, g++ 4.9.1, libc++ and Qt Creator installed on Ubuntu 14.04.1.

I usually use clang++ as compiler. But recently I found that libstdc++ from g++ used as C++ Standard Library. As I know the latter not fully supports C++14 innovations at the moment.

How to replace libstd++ with libc++ when project compiled with clang++?

What I already done (.pro-file):

QMAKE_CXXFLAGS_CXX11 = -std=gnu++1y
CONFIG *= c++11
QMAKE_CXXFLAGS += -stdlib=libc++
LIBS += -stdlib=libc++

But the Qt Creator editor still uses libstdc++ as DEPENDPATH when crawling through included files. How to fix such ill behaviour? Maybe should I fix something in mkspec files?

like image 790
Tomilov Anatoliy Avatar asked Aug 23 '14 09:08

Tomilov Anatoliy


1 Answers

The standard library is specified in the mkspec files.

In linux, you can use : qmake -spec linux-clang-libc++

I think the equivalent in qtcreator is to define a new "kit" and specify "linux-clang-libc++" in the field "Qt mkspec"

like image 134
Moroccan Engineer Avatar answered Sep 25 '22 17:09

Moroccan Engineer