views:

250

answers:

1

I have an iPhone project that uses GHUnit to conduct unit testing. Recently, I've needed to implement complex numbers and overload some operators to ease the calculation of FFTs. The goal here was to create a clean way to perform an FFT without the overhead of all the possible functionality that libraries like FFTW uses, and in this sense, I could further customize the number of calculations I'd like to do in my FFT (so I reduce the complexity of factorizing this or that used in the traditional DFT).

In short, this is why I decided to implement my own FFT library in C++, rather than use FFTW. However, this has caused some problems with GHUnit. All of my production targets work correctly with the integration of my FFT library, but GHUnit refuses to work. Specifically, I get linker errors with things like GHComposeString. This only happens in my Unit Tests target. I'm wondering what this problem might be? At first, I suspected that this may be because of the differences in C vs C++ in how function names are mangled, but it doesn't seem to affect the rest of the project, just the GHUnit portions.

Any help with mixing C++ with GHUnit appreciated.

A: 

This isn't really an answer, but I think you're on the right track with the name mangling. Mangling is done at link time. GHUnit, which inherits from OCUnit, is injected into the app's memory space at runtime by dyld. So, there could conceivably be some kind of issues with GHUnit/OCUnit regarding the mangling of your Obj-C++ files.

dodgio