#SystemProgramming
小trick 1: makefile编译的时候LDFLAG最好放在-o之后。比如要写成
g++ -I/usr/local/include $^ -o $@ -L/usr/local/lib -lunwind
而不要写成:
g++ -I/usr/local/include -L/usr/local/lib -lunwind $^ -o $@
小trick 2: LD_PRELOAD={full_path of the target shared object file}