"marieblasdell" <[EMAIL PROTECTED]> writes: > I changed my program to: > > #include </usr/include/python2.3/Python.h>
That's the wrong way to fix it. The right way is to keep #include <Python.h> and to add -I/usr/include/python2.3 to your compile lines. > 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 > g++ -L/usr/include/python2.3 -lpython2.3 test.cpp > g++ -L/usr/lib/python2.3 -lpython2.3 test.cpp These are all incorrect, although the last one should have worked if libpython2.3.so is installed in default location. Perhaps you should actually read the manuals and try to understand what all the options mean? > 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. Start by "locate libpython2.3.so" which should give you the location of the library you must link with (if it is installed at all). Assuming locate gives you: /foo/bar/baz/libpython2.3.so Correct command would be: g++ -I/usr/include/python2.3 test.cpp -L/foo/bar/baz -lpython2.3 Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. _______________________________________________ help-gplusplus mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gplusplus
