Today, I used swig to encapsulate the underlying C + + library. After the result was encapsulated, release was OK. However, in the debug mode, the import failed all the time, indicating that the module could not be found. Why did I fail when I had PYD?
After troubleshooting, PYD in the original debug mode must be added_ d
The result is to add_ D is solved; For example_ Somelib.pyd should be_ someLib_ d. PYD, so Python can import.
Modify cmakelists.txt to ensure that it is added in debug mode_ d
set(CMAKE_DEBUG_POSTFIX _d)
set_target_properties(${target_name} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})