在Windows上手动编译C ++ Cython

时间:2019-01-26 06:25:12

标签: python c++ cython

按照步骤here和Cython Rectangle示例,我尝试在Windows上使用gcc 64位手动编译它。链接中提到的三个步骤是(我将步骤3修改为Windows,但这可能是错误的):

  1. cython --cplus rect.pyx-> rect.cpp
  2. gcc -c Rectangle.cpp-> Rectangle.o
  3. gcc -shared -fPIC -IC:\ Users \ python37 \ include rect.cpp Rectangle.o -lstdc ++ -o -rect.so

但是在执行步骤3时,我得到了

类型的消息列表。
  

C:\ Users \ xxxx \ AppData \ Local \ Temp \ ccu0rCb7.o:rect.cpp :(。text + 0x1b8):   对__imp_PyDict_Size的未定义引用

     

C:\ Users \ xxxx \ AppData \ Local \ Temp \ ccu0rCb7.o:rect.cpp :(。text + 0x222):   未定义__imp__PyDict_GetItem_KnownHash

有什么办法解决这个问题吗?

0 个答案:

没有答案
相关问题