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

When I include "Python.h" from Python 2.5 in a C++ project, it knows through some magical process that it has to link with "python25.lib" and load "python25.dll" at runtime, though I didn't specified anything neither in "Linker -> Additional Dependencies" nor in "Linker -> Additional Library Directories".

Now I would like to rename python25.lib/.dll to something like gpython25.lib/.dll and link with them. This is to be sure to link with THIS python dll and not another python25.dll from another installed application, independently from the PATH search order.

Is there a way to do that?

Thanks -David

Answers


MSVC supports this feature through pragmas:

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

More info in MSDN.

Look into Python.h file and modify the name of the linkage, if that what you want.


Need Your Help

Template method enable_if specialization

c++ class templates c++11 enable-if

i have following code that does not compile.

How to use Styled Google maps?

html google-maps google-maps-api-3

I am very new to using Google Maps API and I can't get it to work.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.