1

I am new to cython. I have a project file project_file.pyx which I would like to manually create a .cpp file with.

I have tried cython project_file.pyx but this produces project_file .c. However I would like to produce the file project_file.cpp.

How can I do this? I'm running a Linux environment.

halfer
  • 19,471
  • 17
  • 87
  • 173
Stacey
  • 4,327
  • 15
  • 47
  • 83
  • This answer lists all the options: https://stackoverflow.com/a/63838304/5769463 – ead Mar 09 '21 at 14:12

1 Answers1

1

You should put this line at the top of your .pyx file:

# distutils: language = c++

This should compile it in to a .cpp file.

user1321988
  • 483
  • 2
  • 5