0

I am new to Cython and I wanted to wrap a simple c-function to python. In the C-File i use: #include<complex.h>

When i try to build the wrapper i get following error:

lib/mandelbrot_c.c(10): error C2146: Syntaxfehler: missing";" before "c"
lib/mandelbrot_c.c(10): error C2065: "c": not declared
lib/mandelbrot_c.c(10): error C2065: "z": not declared
...

The problem is that the macro does not work i guess.

The code used in the c-file is: double complex c, z;

The files can be found here: https://github.com/HaidStefan/python_wrap_c_libraries/tree/dev/cython

Does anyone know a solution for this? Sorry if this question is dumb but i am new to cython and I'm trying to make a benchmark between different wrappers.

Thanks a lot in advance Stefan

Equintox
  • 11
  • 3
  • 1
    The problem isn’t cython but the MSVC, which doesn’t support C90 fully, in particular complex numbers. Your c-file must be changed in order to be able to compile with MSVC – ead Jul 30 '18 at 14:27
  • Okay thanks, i already thought that the problem is not cython because i just tried using cffi and got the same problem – Equintox Jul 30 '18 at 14:35

1 Answers1

0

The complex library from the C99 standard library is not supported fom the MSVC compiler, which is used to build cython. See: Compiling C code in Visual Studio 2013 with complex.h library

Equintox
  • 11
  • 3