Python: undefined reference to `_imp __Py_InitModule4'

前端 未结 6 990
天涯浪人
天涯浪人 2020-12-05 11:59

I\'m trying to do a debug build of the Rabbyt library using mingw\'s gcc to run with my MSVC built python26_d.. I got a lot of undefined references which caused me to create

6条回答
  •  一个人的身影
    2020-12-05 12:25

    In the file C:\Python27\Lib\distutils\cygwinccompiler.py, which contains the MinGW compiler settings, find the Mingw32CCompiler class:

    self.set_executables(compiler='gcc -O -Wall',
        compiler_so='gcc -mdll -O -Wall',
        compiler_cxx='g++ -O -Wall',
        linker_exe='gcc ',
        linker_so='%s %s %s'
            % (self.linker_dll, shared_option,
            entry_point))
    

    and add -D MS_WIN64 to the compiler_so argument:

    compiler_so='gcc -mdll -O -Wall -D MS_WIN64'
    

提交回复
热议问题