470,591 Members | 2,162 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

C\C++ Python embedding linking problem

Hi all,

I am new to Python and trying to embed it into a c/c++ application. I
started with examples from the documentation pages and go to the Pure
Embedding example (http://docs.python.org/ext/pure-embedding.html). I
can compile and run this example on wxDevC++ with a mingwin compiler.
However when I tried this with Borland C++ Builder 5 I get linker
errors.

The code is the same exactly (the same main.c file), the only
difference is the library I am using, as Borland requires OMF format
library (I have converted it from). I am using the same binary
distribution of Python on win XP. As far as I can tell the functions
the linker complains about are not in the converted library or the
original.

[Linker Error] Unresolved external '_Py_InitModule4TraceRefs'
referenced from C:\PROGRAM FILES\BORLAND\CBUILDER5\PROJECTS\EXP
\TRY2\PETMAIN.OBJ
[Linker Error] Unresolved external '__Py_RefTotal' referenced from C:
\PROGRAM FILES\BORLAND\CBUILDER5\PROJECTS\EXP\TRY2\PETMAIN. OBJ
[Linker Error] Unresolved external '__Py_NegativeRefcount' referenced
from C:\PROGRAM FILES\BORLAND\CBUILDER5\PROJECTS\EXP\TRY2\PETMAIN. OBJ
[Linker Error] Unresolved external '__Py_Dealloc' referenced from C:
\PROGRAM FILES\BORLAND\CBUILDER5\PROJECTS\EXP\TRY2\PETMAIN. OBJ

As far as I can tell it is a problem with my Borland setup but I
cannot find what it is...

Any help is greatly appreciated,

Ross
Jun 27 '08 #1
0 1164

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Anand K Rayudu | last post: by
reply views Thread by Marcin 'Qrczak' Kowalczyk | last post: by
2 posts views Thread by Roose | last post: by
1 post views Thread by Tommy Nordgren | last post: by
3 posts views Thread by John Pye | last post: by
4 posts views Thread by Julian | last post: by
reply views Thread by marcell71 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.