使用SWIG链接到gtkglext的任何内容都会在退出时崩溃Python。为什么这会崩溃?为什么SWIG在链接到gtkglext时崩溃Python?
test.i:
%module test
%{
void test() { printf("Test.\n"); }
%}
void test();
会议:
$ swig -python test.i
$ g++ -I/usr/include/python2.6 -shared -fPIC -o _test.so test_wrap.c -lpython2.6
$ python -c 'import test; test.test()'
Test.
$ g++ -I/usr/include/python2.6 -shared -fPIC -o _test.so test_wrap.c -lpython2.6 `pkg-config --libs gtkglext-1.0`
$ python -c 'import test; test.test()'
Test.
Segmentation fault
任何想法?谢谢...
当你在gdb下运行它会发生什么?跟踪使用'python -v'怎么样?核心转储是否在不调用test.test()的情况下发生?另外,尝试使用setup.py文件来构建扩展,所以Python本身管理编译器标志以及所需的库和库顺序。 – 2009-11-26 07:29:10