Domanda

Tutto ciò che collego a gtkglext usando SWIG va in crash Python all'uscita. Perché questo arresto?

test.i:

%module test
%{
void test() { printf("Test.\n"); }
%}
void test();

Sessione:

$ 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

Qualche idea? Grazie ...

È stato utile?

Soluzione

Devi avviare gtk correttamente.

$ 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.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top