Python: undefined reference to `_imp __Py_InitModule4'

前端 未结 6 982
天涯浪人
天涯浪人 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条回答
  •  萌比男神i
    2020-12-05 12:23

    I have seen this if you try to mix object code compiled for debugging (_DEBUG macro is defined) with non-debug objects (_DEBUG is not defined).

    There is a line in the python core code that #defines Py_InitModule4 to another name (Py_InitModule4TraceRefs) to trigger a "link-time error" (!sic) if you mix objects.

    Make sure you link against a python debug library when you compile for debugging and vice-versa.

提交回复
热议问题