gpt4 book ai didi

c++ - 如何在 i686-apple-darwin11-llvm-g++-4.2 中包含 Accelerate 框架?

转载 作者:行者123 更新时间:2023-11-28 07:50:42 27 4
gpt4 key购买 nike

我正在尝试使用 Accelerate framework在一个小的 C++ 程序上。我什至没有使用 XCode,只使用了一个简单的 Makefile。

当我在代码中添加以下行时,编译器会报错:

#include <Accelerate/Accelerate.h>

错误如下:

In file included from /System/Library/Frameworks/vecLib.framework/Headers/vecLib.h:41,
from /System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h:20,
from Diana.cpp:20:
/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h:9008: error: expected identifier before numeric constant
/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h:9008: error: expected `}' before numeric constant
/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h:9008: error: expected unqualified-id before numeric constant
/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h:9028: error: expected declaration before ‘}’ token

我使用的编译器是i686-apple-darwin11-llvm-g++-4.2,这是一个gcc 4.2.1,以及我用来编译(不是链接)的行是:

i686-apple-darwin11-llvm-g++-4.2 -D__MACOSX_CORE__ -c -o Diana.o Diana.cpp

编译时我应该添加一些额外的标志吗?我尝试添加“-framework Accelerate”,但它没有改变任何东西,因为这应该只包含在链接过程中(我说得对吗?)。

我用谷歌搜索了其中一些错误消息,但没有找到任何内容。

如果有任何帮助,我将不胜感激。谢谢!

PS:我的OS X版本是Lion 10.7.5,XCode是4.4.1。

最佳答案

我想通了:我检查了 vDSP.h 的第 9008 行,问题是我在包含 Accelerate.h 之前声明了一个 FFT_FORWARD 常量。

已修复!

关于c++ - 如何在 i686-apple-darwin11-llvm-g++-4.2 中包含 Accelerate 框架?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13851597/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com