2006年10月19日 星期四 09:57
我用 g++ testpy.cpp -I/usr/include/python2.2 -L/usr/lib/python2.2/config -lpython2.2 -lpthread -ldl -lutil 可以通过,但有警告: g++ testpy.C -I/usr/include/python2.2 -L/usr/lib/python2.2/config -lpython2.2 -l /usr/lib/python2.2/config/libpython2.2.a(posixmodule.o)(.text+0x3977): In funct: : the use of `tmpnam_r' is dangerous, better use `mkstemp' /usr/lib/python2.2/config/libpython2.2.a(posixmodule.o)(.text+0x385e): In funct: : the use of `tempnam' is dangerous, better use `mkstemp' 运行时有错误,是Python import时的错误,改为一个“print 'Hello world!'”就可以了。 Traceback (most recent call last): File "", line 1, in ? ImportError: /usr/lib/python2.2/lib-dynload/timemodule.so: undefined symbol: Pyg 我试的是Python2.2的。 另外,*.C文件是C++源程序,应该用g++的,gcc不能编译。 金庆 http://blog.csdn.net/jq0123 2006-10-19 ======= 2006-10-18 14:01:00 您在来信中写道:======= >你的问题其实和 python 本身无关. 你最好就近找一个资深的 Linux 程序员求助。我现在只看出少了 -ldl -lpthread -lutil > > >另外你用 g++ 而不是 gcc 也很奇怪. >_______________________________________________ >python-chinese >Post: send python-chinese at lists.python.cn >Subscribe: send subscribe to python-chinese-request at lists.python.cn >Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn >Detail Info: http://python.cn/mailman/listinfo/python-chinese = = = = = = = = = = = = = = = = = = = =
Zeuux © 2025
京ICP备05028076号