Problem embedding Python...

Andrew McCall andrew.mccall at gmail.com
Mon Apr 10 09:35:44 EDT 2006


Hi Folks,

I have now managed to work out how to embed Python to allow me to
script my application, the only problem is I am getting a compiler
error when I try to compile:

The error is:

Compiler: Default compiler
Executing  g++.exe...
g++.exe "C:\Documents and
Settings\andy.mccall\Desktop\PythonEmbed\main.cpp" -o "C:\Documents and
Settings\andy.mccall\Desktop\PythonEmbed\main.exe"
-I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include"
-I"C:\Dev-Cpp\include\c++\3.4.2\backward"
-I"C:\Dev-Cpp\include\c++\3.4.2\mingw32"
-I"C:\Dev-Cpp\include\c++\3.4.2"  -I"C:\Dev-Cpp\include"
-I"C:\Python24\include"   -L"C:\Dev-Cpp\lib" -L"C:\Python24\Lib"
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x2b):main.cpp:
undefined reference to `_imp__Py_Initialize'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x3e):main.cpp:
undefined reference to `_imp__PyString_FromString'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x4e):main.cpp:
undefined reference to `_imp__PyImport_Import'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x68):main.cpp:
undefined reference to `_imp__PyModule_GetDict'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x80):main.cpp:
undefined reference to `_imp__PyDict_GetItemString'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x96):main.cpp:
undefined reference to `_imp__PyCallable_Check'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0xb7):main.cpp:
undefined reference to `_imp__PyObject_CallFunction'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0xcd):main.cpp:
undefined reference to `_imp__PyInt_AsLong'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x146):main.cpp:
undefined reference to `_imp__Py_Finalize'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x17c):main.cpp:
undefined reference to `_imp__PyArg_ParseTuple'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x1a6):main.cpp:
undefined reference to `_imp__Py_BuildValue'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x1c2):main.cpp:
undefined reference to `_imp__PyImport_AddModule'
C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x1f0):main.cpp:
undefined reference to `_imp__Py_InitModule4'
collect2: ld returned 1 exit status

Execution terminated

Can anyone help me please?

Thanks,

Andrew.




More information about the Python-list mailing list