次のように定義された 2 つの関数を使用して、test.c という名前の ac ファイルを作成します。
#include<stdio.h>
void hello_1(void){
printf("hello 1\n");
}
void hello_2(void){
printf("hello 2\n");
}
その後、次のように test.pyx を作成します。
import cython
cdef extern void hello_1()
設定ファイルは次のとおりです。
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(cmdclass={'buld_ext':build_ext},
ext_modules=[Extension("test",["test.pyx", "test.c"],
include_dirs=[np.get_include()],
extra_compile_args=['-g', '-fopenmp'],
extra_link_args=['-g', '-fopenmp', '-pthread'])
])
セットアップ ファイルを実行すると、hello_1 と hello_2 には複数の定義があることが常に報告されます。誰でも問題を教えてもらえますか?