tags:

views:

28

answers:

1

Hi, When I try to use the cl -LD test.c -test.dll, it says can not open "python26.lib", why this happens?? thank you. (I was trying to generate a dll file by this command so that python could call it)

+1  A: 

Taken from this link - Hope this will help you -

This is caused by the following lines in the file c:\Python26\include \pyconfig.h

# ifdef _DEBUG
# pragma comment(lib,"python26_d.lib")
# else
# pragma comment(lib,"python26.lib")
# endif /* _DEBUG */

So please:

  1. Provide python26_d.lib in the installer.

or

  1. Remove this automatic "pragma comment lib" from pyconfig.h, since I can't disable it from the outside (as far as I know).
Sachin Shanbhag
@Sachin, thank you, I also searched this link, then I copy the python26.dll into my c file folder, it did not show the same error, but it showed : "fatal error LNK1120: 1 unsolved external"
serina
Sachin Shanbhag