[Top][All Lists]

[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

locate Python.h
gives me:

I changed my program to:

#include </usr/include/python2.3/Python.h>

int main( void )
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
g++ -L/usr/lib/python2.3 -lpython2.3 test.cpp

and got the message:

/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,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]