How to handle problems with RPATH on Mac OS X while installing cmocka?
我正在尝试在Mac OSX Yosemite 10.10.3上安装并运行
更新:
感谢@baf,我能够手动将
1 | set(CMAKE_C_FLAGS_DEBUG"-I/usr/local/include/cmocka.h") |
但是,为什么我必须手动完成呢?
我已经尝试了许多不同的安装方式:
到目前为止我做了什么:
从这里下载cmocka:这里。版本1.0。
我在这里收到这样的消息:
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run"cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
cmocka_shared
This warning is for project developers. Use -Wno-dev to suppress it.
问题1:如何设置
sudo
sudo
现在应该安装
运行
所以现在我为我的程序运行
1 2 3 4 | find_library (CMOCKA cmocka) if (NOT CMOCKA) message (WARNING"Cmocka library not found.") endif (NOT CMOCKA) |
但是在此阶段没有出现警告,所以我相信
为我的程序运行
运行
1
2
3
4
5 fatal error:
'cmocka.h' file not found
#include <cmocka.h>
^
1 error generated.
所以我猜不能找到
问题2:为什么
补充笔记:
我试过跑步
1 | $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH |
但它没有帮助。我想这是Linux的解决方案,而不是Mac。
我试图通过他们的官方文档在
我尝试使用
此外,我在SO上阅读了许多关于
-
如何在Mac OSX下使用gcc设置可执行文件的运行时路径(-rpath)?
-
https://stackoverflow.com/questions/29721183/getting-undefined-symbols-for-architecture-x86-64-when-trying-to-build-on-osx
-
如何使用mac上的rpath配置scons链接?
-
mariadb安装失败:make(Mac OSX 10.6.8)
我跑了
1 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: cmocka (No such file or directory)
当我将
1 | set(CMAKE_C_FLAGS_DEBUG"-std=gnu99 -Wall -pedantic -g -I/usr/local/include/cmocka.h") |