ivanmejiarocha / micro-service

sample micro-service in C++
MIT License
263 stars 129 forks source link

build errors with clang on 32bit of ubuntu 16 #6

Open tongzhipeng opened 6 years ago

tongzhipeng commented 6 years ago

my build enviroment: clang3.8 on ubuntu 16.04 32bit

if [[ "$OSTYPE" == "linux-gnu" ]]; then
    export CXX=g++-4.9
fi

need to be commented in libs/build_dependencies.sh.

CMAKE_CXX_FLAGS need to change to

set(CMAKE_CXX_FLAGS "-m32 -std=c++11 -pthread -DBOOST_LOG_DYN_LINK -Wno-deprecated-declarations")

-stdlib=libc++ need libc++-dev to be installed for llvm, but still leads to error: fatal error: '__cxxabi_config.h' file not found, i've googled it, It seems like an ubuntu16 bug for clang3.8, so i just remove -stdlib=libc++.

-pthread need to be added to resove link error: network_utils.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2

ivanmejiarocha commented 6 years ago

Hi Tongshipen, I'd never tried using clang on linux, only gcc have you have success on this?

Thanks, Ivan.

tongzhipeng commented 6 years ago

No, I 'd never tried compiled it with gcc. my problem is resolved by the changing in the issue, this issue is just a information.