[1.61.0][container] Error compiling alloc_lib.c with -std=c++11
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@blueskystudios.com Blue Sky Studioshttp://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560
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++.
<cxxflags>/<cflags> instead of <compileflags>? Best, Ion
On 07/01/2016 04:05 PM, Ion Gaztañaga wrote:
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++.
<cxxflags>/<cflags> instead of <compileflags>?
Best,
Ion
Thanks. That worked. I am using cxxflags and cflags for the C++ and C-specific flags, and compileflags for the common options (e.g., -fPIC -gcc-toolchain ...). -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studioshttp://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560
participants (2)
-
Ion Gaztañaga
-
Richard Hadsell