Boost logo

Boost :

Subject: [boost] [1.61.0][container] Error compiling alloc_lib.c with -std=c++11
From: Richard Hadsell (hadsell_at_[hidden])
Date: 2016-07-01 11:27:31


I am trying to build Boost 1.61.0 with Clang and C++11 features. Other parts of the library warn about using C++11 features, if I do not build with the option -std=c++11. However, this C source file gives an error, and I assume it does not build at all:

clang-linux.compile.c.without-pth bin.v2/libs/container/build/clang-linux-3.5.0/release/instruction-set-core2/threading-multi/alloc_lib.o
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'

   "[snip]clang++" -c -x c -O3 -Wno-inline -Wall -std=c++11 -fPIC -gcc-toolchain [snip]gcc/4.8.3 -Wno-[snip] -march=core2 -pthread -fPIC -m64 -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTAINER_DYN_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/container/build/clang-linux-3.5.0/release/instruction-set-core2/threading-multi/alloc_lib.o" "libs/container/src/alloc_lib.c"

...failed clang-linux.compile.c.without-pth bin.v2/libs/container/build/clang-linux-3.5.0/release/instruction-set-core2/threading-multi/alloc_lib.o...

These are the options from my user-config:

using clang : 3.5.0 : [snip]/clang++ : <compileflags>"-std=c++11 -fPIC -gcc-toolchain [snip]/gcc/4.8.3 -Wno-[snip]" <linkflags>"-fPIC -gcc-toolchain [snip]/gcc/4.8.3" ;

I don't see a way to provide C++-only flags or C-only flags. Actually, I thought that all Boost source files would be C++.

-- 
Dick Hadsell			203-992-6320  Fax: 203-992-6001
Reply-to:			hadsell_at_[hidden]
Blue Sky Studioshttp://www.blueskystudios.com
1 American Lane, Greenwich, CT 06831-2560

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk