You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delay-loading of python dll is impossible when using some C macros #76552
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2017-12-19.13:13:18.859>labels= ['build', '3.8', 'OS-windows']
title='Delay-loading of python dll is impossible when using some C macros'updated_at=<Date2019-11-19.15:28:56.506>user='https://bugs.python.org/PierreChatelier'
Just reproduced and solved it at the same time !
It happened with Debug build, where I linked to pythonxx.lib instead of pythonxx_d.lib, because I did not download the debug binaries.
Ultimately : my fault.
PierreChatelier commented on Nov 19, 2019
PierreChateliermannequin
MannequinAuthor
More actions
Aaand finally there is still something : it depends on the call context. Once in a C++/CLI class, the link bug occurs again.
Here is attached a minimal project.
Activity
PierreChatelier commentedon Dec 19, 2017
Delay-loading of the python DLL is impossible when using some C macros.
For instance, PyLong_Check() is OK, but PyBool_Check() or PyFunc_Check()
will eventually raise a link error.
This is due to the fact that PyBool_Check() directly use the PyBool_Type symbol instead of getting a reference through a function.
For the same reason, Py_False and Py_True are problematic.
isidentical commentedon Nov 18, 2019
Can you give us a case where we can reproduce this locally?
PierreChatelier commentedon Nov 19, 2019
Can't reproduce any more.
It might have been specific to the Visual Studio version I used at that time.
zware commentedon Nov 19, 2019
Thanks for reporting back. If you find that you can provide a reliable reproducer later, do please reopen and attach it.
PierreChatelier commentedon Nov 19, 2019
Just reproduced and solved it at the same time !
It happened with Debug build, where I linked to pythonxx.lib instead of pythonxx_d.lib, because I did not download the debug binaries.
Ultimately : my fault.
PierreChatelier commentedon Nov 19, 2019
Aaand finally there is still something : it depends on the call context. Once in a C++/CLI class, the link bug occurs again.
Here is attached a minimal project.