Mailing List Archive

Libraries needed, please help!!!
Hi!

I wanted to embed Python into C. I looked for the libraries to link them to
my program. But I haven't the libraries. I looked for it in the Internet and
everywhere, but never found.

Please give me a hint, where I can download the files:
libModules.a
libPython.a
libObject.a
libParser.a

Thank you very much!!!
Sven

--
______________________________________
German Aerospace Research Establishment
Libraries needed, please help!!! [ In reply to ]
Sven Drescher <Sven.Drescher@dlr.de> wrote:
> I wanted to embed Python into C. I looked for the libraries to link them to
> my program. But I haven't the libraries. I looked for it in the Internet and
> everywhere, but never found.
>
> Please give me a hint, where I can download the files:
> libModules.a
> libPython.a
> libObject.a
> libParser.a
>
> Thank you very much!!!

assuming you're on unix,

1) get sources from www.python.org
2) unpack
3) type "./configure"
4) type "make"

ta da!

</F>
Libraries needed, please help!!! [ In reply to ]
Hi!

I did it.
The only file I found was 'libpython1.5.a'.
This you told me in the other mail.

Ok. Thanks!

But how can I get the other files (libModules.a, libPython.a, libParser.a,
libObjects.a) from libpython1.5.a?

Or can anybody send me these files (SUN/Solaris OS)???
All trials with make and configure were not successful.

Thanks for more hints and comments!

Sven
Libraries needed, please help!!! [ In reply to ]
Sven Drescher writes:
> But how can I get the other files (libModules.a, libPython.a, libParser.a,
> libObjects.a) from libpython1.5.a?

Use libpython1.5.a instead of the others; it replaces all four of
them to make embedding easier.


-Fred

--
Fred L. Drake, Jr. <fdrake@acm.org>
Corporation for National Research Initiatives
Libraries needed, please help!!! [ In reply to ]
Thanks!

But there are still errors.

My programm is very little, so I think, there are no syntax errors in it:

#include "Python.h"
int main(int argc, char **argv)
{
Py_Initialize();
PyRun_SimpleString("print 'Hallo, embedded world!'");
return 1;
}

Ok. I compiled and linked my program with the command:

CC -I/path/to/include/ -L/path/to/lib/ -lpython1.5 -o gui gui.cxx

errors:
undefined symbols ... first referenced in 'my_object_file.o'

The undefined symbols Py_Initialize and PyRun_SimpleString are still the
error messages.
What did I wrong?
Can anybody send me the compiler-options for embedding needed object-files
or other flags? Has anyone written a makefile, to do these work?

Thanks a lot!
Sven
Libraries needed, please help!!! [ In reply to ]
Sven Drescher wrote:
> Thanks!
>
> But there are still errors.
>
> My programm is very little, so I think, there are no syntax errors in it:
>
> #include "Python.h"
> int main(int argc, char **argv)
> {
> Py_Initialize();
> PyRun_SimpleString("print 'Hallo, embedded world!'");
> return 1;
> }
>
> Ok. I compiled and linked my program with the command:
>
> CC -I/path/to/include/ -L/path/to/lib/ -o gui gui.cxx
> errors:
> undefined symbols ... first referenced in 'my_object_file.o'
>
> The undefined symbols Py_Initialize and PyRun_SimpleString are still the
> error messages.
> What did I wrong?
> Can anybody send me the compiler-options for embedding needed object-files
> or other flags? Has anyone written a makefile, to do these work?

Order matters? Try:

CC -I/path/to/include/ -L/path/to/lib/ -o gui gui.cxx -lpython1.5

Good luck

Berthold
--
email: hoel@GermanLloyd.org
)
(
C[_] These opinions might be mine, but never those of my employer.
Libraries needed, please help!!! [ In reply to ]
> Order matters? Try:
>
> CC -I/path/to/include/ -L/path/to/lib/ -o gui gui.cxx -lpython1.5
>
> Good luck
>
> Berthold
> --
> email: hoel@GermanLloyd.org
> )
> (
> C[_] These opinions might be mine, but never those of my employer.

I tried, but there are more undefined symbols yet. All symbols are first
referenced in libpython1.5.a(socketmodule.o)!

Who know what else can I do? Has anybody done this before?

Thanks!
Sven
Libraries needed, please help!!! [ In reply to ]
Sven Drescher writes:
> > Order matters? Try:
> >
> > CC -I/path/to/include/ -L/path/to/lib/ -o gui gui.cxx -lpython1.5
> >
> > Good luck
> >
> > Berthold
> > --
> > email: hoel@GermanLloyd.org
> > )
> > (
> > C[_] These opinions might be mine, but never those of my employer.
>
> I tried, but there are more undefined symbols yet. All symbols are first
> referenced in libpython1.5.a(socketmodule.o)!

Are the missing symbols socket-related (gethostbyname, etc.)? If
you're doing all this on Solaris, you need to link with "-lsocket
-lnsl" to get all the symbols.


-Fred

--
Fred L. Drake, Jr. <fdrake@acm.org>
Corporation for National Research Initiatives
Libraries needed, please help!!! [ In reply to ]
> > > Order matters? Try:
> > >
> > > CC -I/path/to/include/ -L/path/to/lib/ -o gui gui.cxx -lpython1.5
> > >
> > > Good luck
> > >
> > > Berthold
> > > --
> > > email: hoel@GermanLloyd.org
> > I tried, but there are more undefined symbols yet. All symbols are
first
> > referenced in libpython1.5.a(socketmodule.o)!
>
> Are the missing symbols socket-related (gethostbyname, etc.)? If
> you're doing all this on Solaris, you need to link with "-lsocket
> -lnsl" to get all the symbols.
>
> -Fred
> --
> Fred L. Drake, Jr. <fdrake@acm.org>
> Corporation for National Research Initiatives

Thanks!
Many errors are removed.

But there are two undefined symbols yet:
- importdl.o
- regexpr.o

Could you help me more, please???

Thanks a lot!
Sven