error D8021 :无效的数值参数“/Wno-cpp” cython_bbox

x33g5p2x  于2021-11-10 转载在 其他  
字(0.7k)|赞(0)|评价(0)|浏览(261)

windows系统,编译cython_bbox时,编译参数:

from setuptools import setup, find_packages, Extension

import numpy as np

ext_modules = [
    Extension(
        "cython_bbox",
        ["utils/cython_bbox.pyx"],
        extra_compile_args=["-Wno-cpp", "-Wno-unused-function"],
        include_dirs=[np.get_include()],
    )
]

报错:

error D8021 :无效的数值参数“/Wno-cpp”

error D8021 :无效的数值参数“/Wno-unused-function”

解决方法:

from setuptools import setup, find_packages, Extension

import numpy as np

ext_modules = [
    Extension(
        "cython_bbox",
        ["utils/cython_bbox.pyx"],
        extra_compile_args=["-std=c++14"],
        include_dirs=[np.get_include()],
    )
]

或者:

extra_compile_args=["-std=c99"],

然后编译ok:

代码来源

GitHub - yhsmiley/bytetrack_realtime

相关文章