Which C++ compiler are you using? The code works in g++. I'd try commenting out the typedef for s7_complex in the __cplusplus section (i.e. maybe your compiler wants the C form of the typedef).