主题 : 求教libnet移植问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 78516
精华: 0
发帖: 19
金钱: 95 两
威望: 19 点
综合积分: 38 分
注册时间: 2012-09-21
最后登录: 2013-05-29
楼主  发表于: 2013-04-07 13:44

 求教libnet移植问题

新人没有移植经验,按照网上说的在电脑上编译安装好libnet
    #cd libnet-1.1.5
    #./configure CC=arm-linux-gcc --host=arm-linux prefix=/usr/local/arm/4.3.2/
    #make
    #make install
然后arm-linux-gcc test.c  -o test  -L /usr/local/arm/4.4.3/lib编译一个测试程序出现下面错误
/tmp/cchtAhU6.o: In function `main':
test.c:(.text+0x120): undefined reference to `libnet_init'
test.c:(.text+0x1a4): undefined reference to `libnet_build_ethernet'
test.c:(.text+0x1ac): undefined reference to `libnet_write'
collect2: ld returned 1 exit status
要怎么解决    希望有人能帮帮我   急用

*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2013-04-07 21:13
如果libnet编译出来的库是libXXX.so的话,我想你可以试试在命令行上加上"-lXXX"来告诉ld要链接libXXX库。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."