When you use a function from another file with cimport , Cython needs a definition file ( *.pxd file) as well as an implementation file. (see here for the relevant section of the documentation)
If you also create a file called f1.pxd containing the following:
cpdef double func1()
Your example should compile.
source share