How to embed Python 2.4 in C++ application using VS C++ 6.0?

Discussion in 'Software' started by nemesys571, Apr 19, 2013.

  1. nemesys571

    nemesys571

    Joined:
    Apr 18, 2013
    Messages:
    1
    Likes Received:
    0
    I get this linking error, using Python 2.4 and MS VC++ 6:

    Code:
    Linking...
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__Py_Finalize
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyErr_Occurred
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyErr_Print
    testPyEmb.obj : error LNK2001: unresolved external symbol _printf
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyInt_AsLong
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyObject_CallObject
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyTuple_SetItem
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyInt_FromLong
    testPyEmb.obj : error LNK2001: unresolved external symbol _atoi
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyTuple_New
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyCallable_Check
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyObject_GetAttrString
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyImport_Import
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyString_FromString
    testPyEmb.obj : error LNK2001: unresolved external symbol __imp__Py_Initialize
    testPyEmb.obj : error LNK2001: unresolved external symbol _fprintf
    testPyEmb.obj : error LNK2001: unresolved external symbol __iob
    This did not help:
    > Just do:
    > #undef _DEBUG /* Link with python24.lib and not python24_d.lib */
    > #include <Python.h>

    I modified pyconfig.h to disable debug mode and force use of python24.lib instead of python24_d.lib and I added python24.lib and its path to the linker options, under Input, as shown here: h t t p : / / tutorial.debashis.net/?p=57&cpage=1
    Still, same error.

    Any ideas?
     
    nemesys571, Apr 19, 2013
    #1
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.