Die Veröffentlichung wird mit der Debugbibliothek zusammengestellt und umgekehrtC++

Programme in C++. Entwicklerforum
Anonymous
 Die Veröffentlichung wird mit der Debugbibliothek zusammengestellt und umgekehrt

Post by Anonymous »

Ein paar Monate später beschloss ich, mein altes Projekt zu erstellen, das die Python -Laufzeit verwendet. Und es war ein Wunder: Die Veröffentlichung würde nicht erbaut, es gab ein ungelöstes externes Symbol py_initialize usw. Ich habe die Bibliotheken ausgetauscht:

Code: Select all

#ifdef MS_COREDLL
#       if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_BUILTIN)
/* not building the core - must be an ext */
#               if defined(_MSC_VER)
/* So MSVC users need not specify the .lib
file in their Makefile (other compilers are
generally taken care of by distutils.) */
#                       if defined(_DEBUG)
#                               pragma comment(lib,"python311.lib")
#                       elif defined(Py_LIMITED_API)
#                               pragma comment(lib,"python3.lib")
#                       else
#                               pragma comment(lib,"python311_d.lib")
#                       endif /* _DEBUG */
#               endif /* _MSC_VER */
#       endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */
< /code>
Und alles hat funktioniert. Nur für die Veröffentlichung erfordert nun einen Debug -Build von Python (Python311_d.dll).
Kennt jemand den Grund für diese Magie? />[*]msvc sdk v 143

[*]Release runtime flag /MT
[*]Debug runtime flag /MTd

The debug has the _Debug < /code> makro installiert, während die Version
hat

Code: Select all

NODEBUG
.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post