msys2-mingw でPython/C APIを使用しようとしているので、このパッケージをインストールして、次のようmingw-w64-x86_64-python2
に記述しますmain.cpp
。
#include <python2.7\Python.h>
int main(){
return 0;
}
そして、$ g++ main.cpp -o main
これを入力すると、次のメッセージが表示されます。
In file included from \msys64\mingw64\include/python2.7\Python.h:58:0,
from main.cpp:1:
\msys64\mingw64\include/python2.7\pyport.h:907:2: 錯誤:#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
^
In file included from \msys64\mingw64\include/python2.7\Python.h:8:0,
from main.cpp:1:
/usr/include/cygwin/types.h:78:20: 錯誤:一個宣告指定了多個類型
typedef __uint32_t uid_t;
^
/usr/include/cygwin/types.h:78:20: 錯誤:沒有宣告任何東西 [-fpermissive]
/usr/include/cygwin/types.h:84:20: 錯誤:一個宣告指定了多個類型
typedef __uint32_t gid_t;
^
/usr/include/cygwin/types.h:84:20: 錯誤:沒有宣告任何東西 [-fpermissive]
makefile:2: recipe for target 'main' failed
make: *** [main] Error 1
なぜこれらが起こるのか私にはわかりません。エラーでlinking file
はありません(ファイルをリンクしていないため)。私の方法は間違っていますか、それとも間違ったファイルを含めていますか?