Skip to content

richelbilderbeek/travis_qmake_clang_cpp14

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

travis_qmake_clang_cpp14

Branch Travis CI logo
master Build Status
develop Build Status

This GitHub is part of the Travis C++ Tutorial.

The goal of this project is to have a clean Travis CI build, with specs:

  • Build system: qmake
  • C++ compiler: clang (as of 2017-04-27, this is clang 3.8)
  • C++ version: C++14
  • Libraries: STL only
  • Code coverage: none
  • Source: one single file, main.cpp

More complex builds:

Equally complex builds:

Less complex builds:

Troubleshooting

undefined reference to 'std::__1::cout'

Cause:

make

Error message:

clang++ -c -m64 -pipe -Wall -Wextra -Weffc++ -Werror -std=c++14 -stdlib=libc++ -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -o main.o main.cpp
clang++ -m64 -Wl,-O1 -o travis_qmake_clang_cpp14 main.o    -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lpthread 

The compiling is done with -stdlib=libc++, the linking is done without.

Solution:

Add to the .pro file:

QMAKE_LFLAGS += -stdlib=libc++