我正在开发一个需要在cython中进行大量字典查找的项目。为了尝试提高速度,我尝试用libcpp中的unordered_maps替换字典。
CAStar2.c:482:19: fatal error: utility: No such file or directory
#include <utility>
^
compilation terminated.
但是当我尝试在命令行上使用gcc进行编译时,编译失败并带有
Correct = True
while Correct == True:
name = input("Please enter your name: ")
if name.isalpha() == True:
file = open("filename.txt", "a")
file.write("\n" + name)
file.close
print("Wrote to file")
Correct = False
else:
print("Incorrect, Try again")
似乎编译器找不到多个必需文件 我如何将其指向这些文件?
答案 0 :(得分:0)
cython生成的C文件需要由setuptools Extension
编译。
如果手动编译,则需要手动指定setuptools否则将使用的所有include和lib目录。
请参阅cython setuptools documentation here和here for a minimal compile from cmd line example。
答案 1 :(得分:0)
我发现问题是我的编译器没有激活对cython似乎产生的c ++ 11的支持。添加选项-std=c++11
正常编译的所有内容。
感谢所有帮助过的人。