Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:module': 0.04; '#include': 0.05; 'null,': 0.09; 'referenced': 0.09; 'struct': 0.09; '"python.h"': 0.16; '*args)': 0.16; '*self,': 0.16; 'null}': 0.16; 'py_none;': 0.16; 'pymethoddef': 0.16; 'pyobject': 0.16; 'string",': 0.16; 'unresolved': 0.16; '{null,': 0.16; 'static': 0.16; 'subject:problem': 0.19; 'null': 0.23; 'function': 0.26; 'windows': 0.26; 'skip:_ 20': 0.28; 'skip:p 30': 0.28; 'all,': 0.28; 'example': 0.30; 'module': 0.30; '-1,': 0.30; 'compiling': 0.30; 'error': 0.31; 'message-id:@gmail.com': 0.32; 'external': 0.33; 'to:addr:python-list': 0.34; 'doc': 0.35; 'symbol': 0.35; 'charset:us-ascii': 0.36; 'received:74.125.83.174': 0.37; 'received:mail-pv0-f174.google.com': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'to:addr:python.org': 0.39; 'received:74.125': 0.40; 'header:Message-Id:1': 0.61; 'from:no real name:2**0': 0.62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding:x-mailer; bh=ZpLFdrw0yeNWndrnG5AU4WQn7GAQ0ZCIPRJ87OQymyk=; b=xzXUYiXYcmggcxKSoYUtXnvWlhuWwuQ6M84XmO9qJBTyQ79LVsJk/HqNAveaqScmMv 5TqyM2enITB8JlSdmUPV2V6pUSkMpbO+CwmGYEFqIkxOiz3RzNQbgVTQXd3mvoPxjHX+ BT5srNfEb5ZuOlVFl7shEm/3FhRxrAedCCYQg= Date: Wed, 20 Jul 2011 23:33:41 +0800 From: llwaeva@gmail.com To: python-list@python.org Subject: problem in compiling the module in VC2010 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.56.03 [tw] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311176026 news.xs4all.nl 23912 [2001:888:2000:d::a6]:50156 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9975 Hi all, I am compiling the example with MCVS2010 #include "Python.h" static PyObject * ex_foo(PyObject *self, PyObject *args) { printf("Hello, world\n"); Py_INCREF(Py_None); return Py_None; } static PyMethodDef example_methods[] = { {"foo", ex_foo, METH_VARARGS, "foo() doc string"}, {NULL, NULL} }; static struct PyModuleDef examplemodule = { PyModuleDef_HEAD_INIT, "example", "example module doc string", -1, example_methods, NULL, NULL, NULL, NULL }; PyMODINIT_FUNC PyInit_example(void) { return PyModule_Create(&examplemodule); } But it reports the following message: error LNK2001: unresolved external symbol __imp___Py_NoneStruct error LNK2019: unresolved external symbol __imp__PyModule_Create2 referenced in function _PyInit_example My os is windows 7 64-bit. Compiler: VC2010