[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Newbie compiler/pathname/library issue
From: |
marieblasdell |
Subject: |
Newbie compiler/pathname/library issue |
Date: |
12 Jan 2007 10:41:00 -0800 |
User-agent: |
G2/1.0 |
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
- Newbie compiler/pathname/library issue,
marieblasdell <=