Hi! I'm trying to experiment with embedding Python in C++. I'm using
server space where I don't have the permissions to install or change
anything, so I have to figure out what's where, and I know very little
about navigating through a linux system.
At first, my bare-bones program failed because it couldn't find
<Python.h>
locate Python.h
gives me:
/usr/include/python2.3/Python.h
I changed my program to:
#include </usr/include/python2.3/Python.h>
int main( void )
{
Py_Initialize();
Py_Finalize();
return 0;
}
I assume there's probably a better way than including the pathname in
the include, but it recognized Python.h, but still found undefined
references to Py_Initialize and Finalize.
I tried compiling with the command:
g++ -L/usr/include/python2.3 test.cpp
and got the same 'undefined references' message.
I tried compiling with the commands:
g++ -L/usr/include/python2.3 -lpython2.3 test.cpp
or
g++ -L/usr/lib/python2.3 -lpython2.3 test.cpp
and got the message:
/usr/lib/gcc-lib/i486-slackware-linux/3.2.3/../../../../i486-slackware-linux/bin
/ld: cannot find -lpython2.3
I'd appreciate any advice that'd point me in the right direction. The
instructions for embedding Python that I've found just say something
along the lines of: 'Let your compiler know the pathname and where to
find the libraries'....without any specifics.
Thank you,
Marie
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus