Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #9975 > unrolled thread
| Started by | llwaeva@gmail.com |
|---|---|
| First post | 2011-07-20 23:33 +0800 |
| Last post | 2011-07-20 23:33 +0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
problem in compiling the module in VC2010 llwaeva@gmail.com - 2011-07-20 23:33 +0800
| From | llwaeva@gmail.com |
|---|---|
| Date | 2011-07-20 23:33 +0800 |
| Subject | problem in compiling the module in VC2010 |
| Message-ID | <mailman.1299.1311176026.1164.python-list@python.org> |
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
Back to top | Article view | comp.lang.python
csiph-web