ich wollte mal SIP ausprobieren und bin gerade im Tutorial bei Punkt 4.1 (also noch ganz am Anfang).
Dort soll Python mit dem Headerfile word.h bekannt gemacht werden, das so aussieht:
Code: Alles auswählen
class Word {
const char *the_word;
public:
Word(const char *w);
char *reverse() const;
};
Code: Alles auswählen
%Module word 0
class Word {
%TypeHeaderCode
#include <word.h>
%End
public:
Word(const char *w);
char *reverse() const;
};
Um daraus ein Makefile zu machen, wird dieser Code für die configure.py verwendet:
Code: Alles auswählen
import subprocess
import sipconfig
build_file = 'word.sbf'
config = sipconfig.Configuration()
subprocess.call([config.sip_bin, '-c', '.', '-b', build_file, 'word.sip'])
makefile = sipconfig.SIPModuleMakefile(config, build_file)
makefile.extra_libs = ['word']
makefile.generate()
Code: Alles auswählen
~/tutorial/sip$ make
g++ -c -O2 -g -fPIC -Wall -W -I. -I/usr/include/python2.5 -o sipwordcmodule.o sipwordcmodule.cpp
g++ -c -O2 -g -fPIC -Wall -W -I. -I/usr/include/python2.5 -o sipwordWord.o sipwordWord.cpp
g++ -shared -Wl,--version-script=word.exp -o word.so sipwordcmodule.o sipwordWord.o -lword
/usr/bin/ld: cannot find -lword
collect2: ld returned 1 exit status
make: *** [word.so] Fehler 1