P
Paul Volkov
I am trying to compile an extension module with C++ Builder 6 for Python 3.3.
I converted python33.lib using coff2omf.exe and added this library
into my project.
I wonder why I get this error message while building:
[Linker Error] Unresolved external '_PyModule_Create2TraceRefs'
referenced from 'D:\WORK\FROMAGE\OUT\ROSE_UNIT.OBJ'
My source file:
//---------------------------------------------------------------------------
#include <Python.h>
#include <windows.h>
#pragma argsused
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
return 1;
}
static PyObject* __declspec(dllexport) testik(PyObject* self, PyObject* args)
{
return NULL;
}
static PyMethodDef FundRoseMethods[] = {
{"testik", testik, METH_VARARGS, "perform a test"},
{NULL, NULL, 0, NULL}
};
static struct PyModuleDef FundRoseModule = {
PyModuleDef_HEAD_INIT,
"FundRose",
NULL,
-1,
FundRoseMethods
};
PyMODINIT_FUNC
PyInit_FundRose(void)
{
return PyModule_Create(&FundRoseModule);
}
//---------------------------------------------------------------------------
I converted python33.lib using coff2omf.exe and added this library
into my project.
I wonder why I get this error message while building:
[Linker Error] Unresolved external '_PyModule_Create2TraceRefs'
referenced from 'D:\WORK\FROMAGE\OUT\ROSE_UNIT.OBJ'
My source file:
//---------------------------------------------------------------------------
#include <Python.h>
#include <windows.h>
#pragma argsused
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
return 1;
}
static PyObject* __declspec(dllexport) testik(PyObject* self, PyObject* args)
{
return NULL;
}
static PyMethodDef FundRoseMethods[] = {
{"testik", testik, METH_VARARGS, "perform a test"},
{NULL, NULL, 0, NULL}
};
static struct PyModuleDef FundRoseModule = {
PyModuleDef_HEAD_INIT,
"FundRose",
NULL,
-1,
FundRoseMethods
};
PyMODINIT_FUNC
PyInit_FundRose(void)
{
return PyModule_Create(&FundRoseModule);
}
//---------------------------------------------------------------------------