我在Mac上,我曾经homebrew安装过gmp.
Kyumins-iMac:gcjlib math4tots$ g++ main.cpp -lgmp -lgmpxx
In file included from main.cpp:2:
./gcjlib.hpp:4:10: fatal error: 'gmpxx.h' file not found
#include <gmpxx.h>
^
1 error generated.
Run Code Online (Sandbox Code Playgroud)
所以我明确告诉g++要使用/usr/local/include
Kyumins-iMac:gcjlib math4tots$ g++ main.cpp -lgmp -lgmpxx -I/usr/local/include
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
所以我明确告诉g++要使用/usr/local/lib
Kyumins-iMac:gcjlib math4tots$ g++ main.cpp -lgmp -lgmpxx -I/usr/local/include -L/usr/local/lib
Kyumins-iMac:gcjlib math4tots$ ./a.out
sum is -4444
absolute value …Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用boost asio的C++项目.尝试构建使用亚洲的库,我收到以下错误
/usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19:10: fatal error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
Run Code Online (Sandbox Code Playgroud)
brew install openssl
brew link openssl --force
xcode-select --install
Run Code Online (Sandbox Code Playgroud)
但没有帮助.
执行以下操作似乎也不起作用
export C_INCLUDE_PATH=/usr/local/include
export CPLUS_INCLUDE_PATH=/usr/local/include
Run Code Online (Sandbox Code Playgroud)
我正在使用的Boost版本是boost_1_63_0.我MacOS Sierra在一起Xcode 8.3.1.我用Homebrew安装了boost
brew install boost
Run Code Online (Sandbox Code Playgroud)
据我所知,从其他链接来看,Xcode正在寻找ssl头的错误位置.但是我怎么解决这个问题呢?
我看着我的/usr/local/include&/opt/local/include.两个地方都没有'openssl/ssl.h'.但做了brew install openssl以下说明
Warning: openssl is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version
Run Code Online (Sandbox Code Playgroud)
做一个brew …