我已经在/ usr / include中安装了犰狳线性代数库,因此在xcode中,我将此目录添加到搜索路径中:
但是xcode警告我找不到armadillo文件:
然后,我将库文件复制到/ tmp / arma /中,并将其添加到搜索路径中:
奇迹般地一切正常:
我现在真的很困惑。
更新
只是为了确认犰狳确实在/ usr / include中:
kaiyin@kaiyins-mbp 07:30:09 | ~ =>
cd /usr/include/
kaiyin@kaiyins-mbp 07:30:20 | /usr/include =>
realpath armadillo
/usr/include/armadillo
kaiyin@kaiyins-mbp 07:30:25 | /usr/include =>
ll armadillo
-rw-r--r-- 1 root wheel 20K Jun 1 04:44 armadillo
kaiyin@kaiyins-mbp 07:31:24 | /usr/include =>
file armadillo
armadillo: ASCII C++ program text
kaiyin@kaiyins-mbp 07:31:29 | /usr/include =>
head armadillo
// Copyright (C) 2008-2014 Conrad Sanderson
// Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef ARMA_INCLUDES
#define ARMA_INCLUDES
kaiyin@kaiyins-mbp 07:31:32 | /usr/include =>
diff /tmp/arma/armadillo armadillo
kaiyin@kaiyins-mbp 07:32:11 | /usr/include =>
所以它坐在那里,与/ tmp / arma /中的那个相同
最佳答案
是的,它在MAC中有效。实际上,它在任何类似Unix的系统中都能正常工作。
关于c++ -/usr/include不能用作xcode中的搜索路径?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24948618/