Question

I am trying to use the Accelerate framework on a small C++ program. I'm not even using XCode, only a simple Makefile.

The compiler complains when I add the following line to my code:

#include <Accelerate/Accelerate.h>

The error is the following:

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

The compiler I'm using is i686-apple-darwin11-llvm-g++-4.2, which is a gcc 4.2.1, and the line that I use to compile (not to link) is:

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

Should I add some additional flag(s) when compiling this? I tried adding the "-framework Accelerate", but it doesn't change anything, since this should only be included in the linkage process (am I right?).

I googled some of these error messages and I didn't find anything.

I would really appreciate any help. Thank you!

PS: My OS X version is Lion 10.7.5, and XCode is 4.4.1.

Was it helpful?

Solution

I figured it out: I checked what was on line 9008 of vDSP.h and the problem was that I was declaring an FFT_FORWARD constant before including the Accelerate.h.

Fixed!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top