How can I associate (C ++) with renamed Python.lib and .dll?

When I include “Python.h” from Python 2.5 in a C ++ project, it knows through some kind of magic process that it must communicate with “python25.lib” and load “python25.dll” at runtime, although I not "t is specified either in" Linker → Additional Dependencies "or in" Linker → Additional Library Directories ".

Now I would like to rename python25.lib / .dll to something like gpython25.lib / .dll and associate with it. This is because the link to THIS is python dll, and not to another python25.dll from another installed application, regardless of the PATH search order.

Is there any way to do this?

Thanks David

+4
source share
1 answer

MSVC supports this function through pragmas:

#pragma comment(lib, "python25.lib"); 

Additional information on MSDN .

Take a look at the Python.h file and change the link name if you need it.

+1
source

Source: https://habr.com/ru/post/1299417/


All Articles