Compiling extension module (linker error)

Discussion in 'Python' started by Paul Volkov, Oct 22, 2012.

  1. Paul Volkov

    Paul Volkov Guest

    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);
    }

    //---------------------------------------------------------------------------
     
    Paul Volkov, Oct 22, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    564
    Niklas Norrthon
    Dec 7, 2005
  2. Replies:
    4
    Views:
    5,004
    Default User
    Feb 10, 2006
  3. MRAB
    Replies:
    0
    Views:
    136
  4. Paul Volkov
    Replies:
    0
    Views:
    160
    Paul Volkov
    Oct 23, 2012
  5. MRAB
    Replies:
    0
    Views:
    183
Loading...

Share This Page