我在mac os x上有以下iPhone交叉编译的工具链:
# Platform Info
SET (CMAKE_SYSTEM_VERSION 1)
SET (CMAKE_SYSTEM_PROCESSOR arm)
# SDK Info
SET (SDKVER "3.0")
SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
SET (SDKROOT "${DEVROOT}/SDKs/iPhoneOS${SDKVER}.sdk")
SET (CMAKE_OSX_SYS
我按照描述的方式构建了包,并将#include <tins/tins.h>添加到示例文件的头中,从而安装了C++包。我运行了ldconfig,但是构建总是抛出一个未定义的引用错误:
CMakeFiles/lts.dir/main.cpp.o: In function `main':
/home/patrick/ClionProjects/lts/main.cpp:6: undefined reference to `Tins::EthernetII::EthernetII(Tins::HWAddress<6ul, unsigned char> const&
我想用cmake设置一个自定义的工具链。我已经设置了编译器,但我不知道如何设置链接器。报告此错误是因为cmake尝试使用编译器链接:
The C compiler "xgcc.exe" is not able to compile a simple test program.
下面是我的工具链文件的一个片段
# specify the cross compiler
INCLUDE(CMakeForceCompiler)
SET(CMAKE_C_COMPILER xgcc.exe)
SET(CMAKE_CXX_COMPILER xgcc.exe)
#CMAKE_FORCE_C
我试图在Xcode中使用地址清除器,但我也使用ccache来加速我的构建。为此,我在Xcode-project级别设置了CC标志,指向我存储在~/projects/support/cmake/ccache-clang上的脚本。剧本读着
#!/bin/sh
if type -p /usr/local/bin/ccache >/dev/null 2>&1; then
export CCACHE_CPP2=true
exec /usr/local/bin/ccache "${DEVELOPER_DIR}/Toolchains/XcodeDefault.xctool