Hack with Debian

    面朝大海,春暖花开~
备份一些东东  版权不归我管  李群表示理论  小企鹅小技巧  博客建站技术  迷人的篮球世界  好听的歌曲  只是随便写的  哈哈哈哈哈哈  数学牛人轶事  数学资料小抄  深入理解小企鹅  多彩三国世界 

gcc linker option(--rpath) Linux小技巧

rmingming@debian:~/src/blcr-0.4.2/examples/pthread_misc$ gcc -g -O2 -o pthread_misc_sleep100 pthread_misc_sleep100.c -L /usr/local/blcr-0.4.2/lib/ -lcr -lpthread -I /usr/local/blcr-0.4.2/include/ -Wl,--rpath=/usr/local/blcr-0.4.2/lib

或者:

rmingming@debian:~/src/blcr-0.4.2/examples/pthread_misc$ gcc -g -O2 -o pthread_misc_sleep100 pthread_misc_sleep100.c -L /usr/local/blcr-0.4.2/lib/ -lcr -lpthread -I /usr/local/blcr-0.4.2/include/ -Wl,--rpath -Wl,/usr/local/blcr-0.4.2/lib

其中-Wl,option表示将option传给linker,而-rpath dir选项表示把dir加入运行时库搜索路径.

本文由 rmingming 于2007年01月11日 下午09点10分 发表 | 评论 (0)

回复列表