clang compile failed on mariadb - c++

system is CentOS(VirtualBox) x64
I had "yum install" and "yum check" cmake clang gcc libstdc++ and compat-libstdc++*
I had link cmake to clang
I had compile a "HelloWorld" program by clang successed
then,
I try to compile mariadb'code use : "cmake . -DBUILD_CONFIG=mysql_release".
I got error like this:
...
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/clang++" is not able to compile a simple test
program.
...
/usr/bin/ld: cannot find -lstdc++
...
How can I fix this problem? Thanks very much!
(Please forgive me for my poor English T_T)

Getting libstdc++-devel, etc. etc. c++ : # yum install gcc-c++

Related

fatal error: 'openssl/evp.h' file not found cmake + make

Operating system: macOS Catalina
I have a project that has a file called CMakeLists.txt. I ran cmake and then make, but the make command failed:
/Users/blablabla/Downloads/myproject/src/main.cpp:10:10: fatal error:
'openssl/evp.h' file not found
#include <openssl/evp.h>
I tried reinstalling OpenSSL via homebrew, linking the libraries but it still gave this error.
What am I could be doing wrong?
Any help would be highly appreciated
either openssl's dev library is not installed, or the g++ command that cmake generates probably is missing a -I.
try sudo apt-get install libssl-dev first and if that doesn't work, make sure the openssl include dir is provided to g++.
according to https://cmake.org/cmake/help/v3.6/module/FindOpenSSL.html, it creates an env var of OPENSSL_INCLUDE_DIR
edit: just noticed you're on OSX. you can install the the dev libssl package with brew install openssl

How to resolve: Error when bootstrapping CMake on Linux

I received an error while trying to build CMake on Linux. I could not reach the make step. I read around the web but still couldn't really fix this.
I tried both of these, but neither worked:
$ ./configure --prefix=/opt/cmake
$ ./bootstrap
They resulted in:
CMake Error at CmakeLists.txt:107 (message):
The C++ compiler does not support C++11 (e.g. std::unique_ptr).
-- Configuring incomplete, errors occurred
--------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
--------------------------------------------
And:
command -v g++
/usr/bin/g++
g++ --version
g++ (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
The code I am trying to compile is in C, so I'm wondering why I'm receiving errors raised with respect to the C++ Compiler? Perhaps any thoughts on this too?
You can set up the specific gcc and g++ version using the following commands.
export CC=path_of_gcc/gcc-version
export CXX=path_of_g++/g++-version
And now run any of the commands:
./configure #OR
./bootstrap

Fedora V-Play on Qt: cannot find libraries

I am new for VPlay, after I installed V-Play with Qt and I wrote a simple project, and I got error message after compiling:
error: cannot find -lpulse-mainloop-glib
error: cannot find -lpulse
error: cannot find -lglib-2.0
But I tried:
sudo dnf install pulseaudio-libs
sudo dnf install glibs2
It shows that I already installed these libraries, but the result of compiling still the same.
What packages I should install now?
Try installing pulseaudio-libs-devel and glib2-devel.

Installing gevent on Mavericks (Enthought Canopy python)

Has anyone had any luck building gevent 1.0 in Mavericks?
I've tried the following:
pip (as recommended on the gevent package index)
easy_install
compiling from source
I keep getting the same error when building 'gevent.core':
...
building 'gevent.core' extension
creating build/temp.macosx-10.6-i386-2.7/gevent
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.6.sdk
Please check your Xcode installation
gcc -DNDEBUG -g -O3 -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk -U__llvm__ -
DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0
-DEV_PERIODIC_ENABLE=0 -Ibuild/temp.macosx-10.6-i386-2.7/libev -Ilibev -
I/Applications/Canopy.app/appdata/canopy-1.2.0.1610.macosx-
x86/Canopy.app/Contents/include/python2.7 -c gevent/gevent.core.c -o build/temp.macosx-
10.6-i386-2.7/gevent/gevent.core.o
clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.6.sdk'
In file included from gevent/gevent.core.c:17:
/Applications/Canopy.app/appdata/canopy-1.2.0.1610.macosx-
x86/Canopy.app/Contents/include/python2.7/Python.h:33:10: fatal error:
'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
error: command 'gcc' failed with exit status 1
Seems to be a problem with XCode. I made sure I have the XCode (v. 5.0.2) command line tools installed with:
xcode-select --install
But that didn't seem to change anything. Apparently I'm not alone with this problem (a missing /Developer/SDKs/MacOSX10.6.sdk), but I'd like to stick with Enthought's Canopy version of python if I can (and have already spent too much time combing the Apple Developer site to try download MacOSX10.6.sdk directly).
Any suggestions that don't involve starting over with a macport'ed python? Thanks!
IIUC, Apple pulled a fast one on the latest XCode, such that gcc is no longer actually gcc, but is symlinked to clang, which is not compatible with standard Pythons, including Canopy's.
It should work better if you install Xcode 3.2.1 Developer Tools from https://developer.apple.com/downloads/index.action
For me the hint on gevent website helped:
pip install cython git+git://github.com/gevent/gevent.git#egg=gevent

Compiling Boost 1.54 XCode5 for device - fatal error: error in backend: symbol '___umodsi3' can not be undefined in a subtraction expression

I have been able to successfully compile boost 1.54 for the iOS 7.0 simulator using XCode 5, but when trying to compile for device getting this strange clang failure:
darwin.compile.c++ bin.v2/libs/atomic/build/darwin-7.0~iphone/release/architecture-arm/link-static/macosx-version-iphone-7.0/target-os-iphone/threading-multi/lockpool.o
fatal error: error in backend: symbol '___umodsi3' can not be undefined in a subtraction expression
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: arm-apple-darwin12.5.0
Thread model: posix
Here are my user-config.jam settings:
using clang : : : <cxxflags>"-std=c++11 -stdlib=libc++" <linkflags>"-stdlib=libc++" ;
using darwin : 7.0~iphone
: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
: <striper> <root>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
<compileflags>"-arch armv7"
<compileflags>"-arch armv7s"
<compileflags>-mthumb
<compileflags>-fvisibility=hidden
<compileflags>-fvisibility-inlines-hidden
<compileflags>-std=c++11
<compileflags>-stdlib=libc++
<compileflags>-miphoneos-version-min=5.1
<compileflags>-D_LITTLE_ENDIAN
<compileflags>"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk"
: <architecture>arm <target-os>iphone
;
using darwin : 7.0~iphonesim
: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
: <striper> <root>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
<compileflags>"-arch i386"
<compileflags>-fvisibility=hidden
<compileflags>-fvisibility-inlines-hidden
<compileflags>-std=c++11
<compileflags>-stdlib=libc++
<compileflags>-miphoneos-version-min=5.1
<compileflags>-D_LITTLE_ENDIAN
<compileflags>"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk"
: <architecture>x86 <target-os>iphone
;
Detailed steps to reproduce:
1. Download and extract the latest sources for boost 1.54
2. Create a user-config.jam in user's home directory (w text above).
3. Run ./bootstrap.sh in the boost directory
4. Run
./b2 toolset=darwin-7.0~iphone architecture=arm target-os=iphone macosx-version=iphone-7.0 threading=multi linkflags=-stdlib=libc++ define=_LITTLE_ENDIAN link=static install
This will result in the error above.
For comparison, when compiling for the simulator with the following line:
./b2 toolset=darwin-7.0~iphonesim architecture=x86 target-os=iphone macosx-version=iphone-7.0 threading=multi linkflags=-stdlib=libc++ link=static install
This works fine and correctly generates the boost libraries for use with the simulator.
Would anyone have a suggestion as to what could be causing this? Is it a clang compiler problem or am I using the device compile incorrectly? I have been able to compile for device with XCode 4.x with no problem previously...
Thanks!
Daniel
I may have found the answer. Use
<compileflags>-mno-thumb
instead of:
<compileflags>-mthumb
Works for me now.