【发布时间】:2009-03-21 08:23:00
【问题描述】:
我已经安装了 Python 3k(C:\Python30) 和 Visual Studio Professional Edition 2008。
我正在学习this。
这里有个问题:
C:\hello>dir
Volume in drive C has no label.
Volume Serial Number is 309E-14FB
Directory of C:\hello
03/21/2009 01:15 AM <DIR> .
03/21/2009 01:15 AM <DIR> ..
03/21/2009 01:14 AM 481 hellomodule.c
1 File(s) 481 bytes
2 Dir(s) 10,640,642,048 bytes free
C:\hello>cl /LD hellomodule.c /Ic:\Python30\include c:\Python30\libs\python30.lib /link/out:hello.
dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
hellomodule.c
c:\hello\hellomodule.c(26) : warning C4716: 'inithello' : must return a value
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
/out:hellomodule.dll
/dll
/implib:hellomodule.lib
/out:hello.dll
hellomodule.obj
c:\Python30\libs\python30.lib
Creating library hellomodule.lib and object hellomodule.exp
hellomodule.obj : error LNK2019: unresolved external symbol _Py_InitModule referenced in function
_inithello
hello.dll : fatal error LNK1120: 1 unresolved externals
C:\hello>
有什么问题?请指导我。
【问题讨论】:
-
我不确定这是否会有所帮助。我为朋友编译扩展做了一个截屏视频。它与VS2003。 pylot.org/compiling_pylot_cpp_extensions.wmv.
标签: python c visual-studio visual-studio-2008 linker