문제

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.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top