469,936 Members | 2,326 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

Problem embedding Python...

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.

Apr 10 '06 #1
1 6038
> C:\DOCUME~1\ANDY~1.MCC\LOCALS~1\Temp/cckhbaaa.o(.text+0x2b):main.cpp:
undefined reference to `_imp__Py_Initialize'
These errors indicate that the linker can't find the Python library
(python24.lib).
-L"C:\Python24\Lib"


I think you want to say -L"C:\Python24\Libs" instead. 'libs' contains
the binary lib files, while 'lib' contains the .py library files.

--
Want to play tabletop RPGs online?
Check out RPZen: http://koboldsoft.com

Apr 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by Robey Holderith | last post: by
4 posts views Thread by Alicia Haumann | last post: by
reply views Thread by adsheehan | last post: by
1 post views Thread by amit | last post: by
1 post views Thread by Tommy Nordgren | last post: by
6 posts views Thread by John Dean | last post: by
reply views Thread by DevEng | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.