gtkglext에 연결될 때 왜 SWIG가 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
어떤 아이디어? 감사...
해결책
GTK를 올바르게 시작해야합니다.
$ cat test.i
%module test
%{
void test() { printf("Test.\n"); }
%}
void test();
$ swig -python test.i ; gcc -I/usr/include/python2.5 -shared -fPIC -o _test.so test_wrap.c -lpython2.5 `pkg-config --libs gtkglext-1.0`
$ python -c 'import test; test.test()'
Test.
Segmentation fault
$ python -c 'import gtk; import test; test.test()'
Test.
제휴하지 않습니다 StackOverflow