您尚未登录。

楼主 #1 2017-12-27 14:25:25

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

./configure --prefix=$(pwd)/sss --host=arm
make CC=arm-linux-gnueabihf-gcc
make install

成功后
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss# ls
etc  include  lib  sbin  share
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss# cd lib
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib# ls
libnl       libnl-cli-3.a   libnl-genl-3.la   libnl-nf-3.a     libnl-route-3.la
libnl-3.a   libnl-cli-3.la  libnl-idiag-3.a   libnl-nf-3.la    pkgconfig
libnl-3.la  libnl-genl-3.a  libnl-idiag-3.la  libnl-route-3.a
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib# cd libnl
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib/libnl# ls
cli
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib/libnl#

离线

#2 2017-12-27 14:53:54

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

参考这个: basicnet/libnl.html

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make





离线

楼主 #3 2017-12-27 15:30:22

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

参考这个: basicnet/libnl.html

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make


晕哥,上面的方法有错误

/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
.libs/hash.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [libnl-3.la] Error 1
make[2]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make: *** [all-recursive] Error 1

离线

#4 2017-12-27 15:40:42

daydayup
会员
注册时间: 2017-10-09
已发帖子: 343
积分: 343

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

zhuacai 说:
晕哥 说:

参考这个: basicnet/libnl.html

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make


晕哥,上面的方法有错误

/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
.libs/hash.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [libnl-3.la] Error 1
make[2]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make: *** [all-recursive] Error 1

工具链还是得用 ARM的哦, (捂脸

离线

#5 2017-12-27 15:41:23

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

对, 否则就是不识别的指令集了.





离线

#6 2017-12-27 16:44:03

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

你是在编译 wifi 工具集吧? 建议用 buildroot.





离线

楼主 #7 2017-12-27 18:39:12

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

daydayup 说:
zhuacai 说:
晕哥 说:

参考这个: basicnet/libnl.html


晕哥,上面的方法有错误

/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
.libs/hash.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [libnl-3.la] Error 1
make[2]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make: *** [all-recursive] Error 1

工具链还是得用 ARM的哦, (捂脸

用以下命令编译成功后没有libnl-3.so.200
./configure --prefix=$(pwd)/sss     \
        --host=arm  \
            --sysconfdir=/etc \
            --disable-static  &&
make CC=arm-linux-gnueabihf-gcc

离线

楼主 #8 2017-12-27 18:41:29

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

对, 否则就是不识别的指令集了.


晕哥,我是想学习怎样交叉编译,所以想自己编译libnl-3.2.25

离线

#9 2017-12-27 21:38:32

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

libnl-3.so.200 是一个软链接吧,实际应该指向 libnl-3.so
你看下 libnl-3.so 是否存在。





离线

#10 2017-12-27 21:55:18

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

为什么一定要 libnl-3.so.200 ?





离线

楼主 #11 2017-12-27 22:04:26

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

libnl-3.so.200 是一个软链接吧,实际应该指向 libnl-3.so
你看下 libnl-3.so 是否存在。

没有一个.so的文件,我觉下配置关,下面的说明我看不明白
                                  NOTE

There have been some changes starting with 3.2 regarding where and how libnl
is being installed on the system in order to allow multiple libnl versions
to be installed in parallel:

    - Headers will be installed in ${prefix}/include/libnl3, therefore
      you will need to add "-I/usr/include/libnl3" to CFLAGS

    - The library basename was renamed to libnl-3, i.e. the SO names become
      libnl-3.so., libnl-route-3.so, etc.

    - libtool versioning was assumed, to ease detection of compatible library
      versions.

If you are using pkg-config for detecting and linking against the library
things will continue magically as if nothing every happened. If you are
linking manually you need to adapt your Makefiles or switch to using
pkg-config files.

离线

#12 2017-12-27 22:04:37

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

QQ20171227220343.png
我试了一下,明明有生成文件!





离线

#13 2017-12-27 22:05:33

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

NOTE只是提示,仔细看,没毛病。





离线

楼主 #14 2017-12-27 22:26:12

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

https://whycan.cn/files/members/3/QQ20171227220343.png
我试了一下,明明有生成文件!


我的怎么没有,你能写下你的步骤吗
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/lib/.libs# ls
addr.o        error.o          libnl-genl-3.lai   libnl-nf-3.lai     object.o
attr.o        handlers.o       libnl-idiag-3.a    libnl-route-3.a    socket.o
cache_mngr.o  hash.o           libnl-idiag-3.la   libnl-route-3.la   utils.o
cache_mngt.o  hashtable.o      libnl-idiag-3.lai  libnl-route-3.lai  version.o
cache.o       libnl-genl-3.a   libnl-nf-3.a       msg.o
data.o        libnl-genl-3.la  libnl-nf-3.la      nl.o
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/lib/.libs#

离线

#15 2017-12-27 23:17:26

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

执行这个x86编译:

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make





离线

楼主 #16 2017-12-28 08:50:41

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

执行这个x86编译:

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make


晕哥,我的和你那样操做,有错误,是什么问题呢,网上查都查不到
../lib/.libs/libnl-3.so: undefined reference to `nl_hash_any'
collect2: error: ld returned 1 exit status
make[2]: *** [nf-ct-list] Error 1
make[2]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/src'
make: *** [all-recursive] Error 1
root@ubuntu:/home/vv3/Downloads/wif

离线

#17 2017-12-28 09:09:01

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

刚才用办公电脑再试了一次, 仍然非常正常:

wget https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar xvf libnl-3.2.25.tar.gz
./configure --prefix=/usr                 --sysconfdir=/etc             --disable-static
make -j3





离线

#18 2017-12-28 09:24:34

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

用arm-linux工具链也正常

wget https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar xvf libnl-3.2.25.tar.gz
./configure --prefix=/usr                 --sysconfdir=/etc             --disable-static --host=arm-linux
make -j3





离线

楼主 #19 2017-12-28 09:44:53

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

刚才用办公电脑再试了一次, 仍然非常正常:

wget https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar xvf libnl-3.2.25.tar.gz
./configure --prefix=/usr                 --sysconfdir=/etc             --disable-static
make -j3


晕哥,终于可以了可能我的libnl有问题,下面是用的gcc编译吗?如果要编译到v3s上用,要怎么编译?是在make后面跟着CC=arm-linux-gnueabihf-gcc吗
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for arm-linux-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes

离线

#20 2017-12-28 10:16:57

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

zhuacai 说:
晕哥 说:

刚才用办公电脑再试了一次, 仍然非常正常:

wget https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar xvf libnl-3.2.25.tar.gz
./configure --prefix=/usr                 --sysconfdir=/etc             --disable-static
make -j3


晕哥,终于可以了可能我的libnl有问题,下面是用的gcc编译吗?如果要编译到v3s上用,要怎么编译?是在make后面跟着CC=arm-linux-gnueabihf-gcc吗
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for arm-linux-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes

CC估计没用,你用下面这个,我试过了:
./configure --prefix=/usr                 --sysconfdir=/etc             --disable-static --host=arm-gnueabihf-linux





离线

楼主 #21 2017-12-28 10:33:50

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥,我下面的编译方法是不是交叉编译了,可以在v3s里用了吗?
https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar zxvf libnl-3.2.25.tar.gz
cd libnl-3.2.25
./configure --prefix=$(pwd)/aaa     \
        --host=arm-linux-gnueabihf  \
            --sysconfdir=/etc \
            --disable-static  &&
make
make install

离线

#22 2017-12-28 10:38:23

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

zhuacai 说:

晕哥,我下面的编译方法是不是交叉编译了,可以在v3s里用了吗?
https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar zxvf libnl-3.2.25.tar.gz
cd libnl-3.2.25
./configure --prefix=$(pwd)/aaa     \
        --host=arm-linux-gnueabihf  \
            --sysconfdir=/etc \
            --disable-static  &&
make
make install

是交叉编译, 可以用。





离线

#23 2018-12-07 11:19:25

605364021
会员
注册时间: 2018-10-23
已发帖子: 251
积分: 251

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

你是在编译 wifi 工具集吧? 建议用 buildroot.

晕哥,我把buildroot下的库文件拉出来交叉编译出arm架构下的.so文件,这样可以?

离线

#24 2018-12-07 11:22:34

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,248
积分: 9197

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

605364021 说:
晕哥 说:

你是在编译 wifi 工具集吧? 建议用 buildroot.

晕哥,我把buildroot下的库文件拉出来交叉编译出arm架构下的.so文件,这样可以?

可以, 我一直都是这么做的。





离线

#25 2018-12-07 11:24:42

605364021
会员
注册时间: 2018-10-23
已发帖子: 251
积分: 251

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:
605364021 说:
晕哥 说:

你是在编译 wifi 工具集吧? 建议用 buildroot.

晕哥,我把buildroot下的库文件拉出来交叉编译出arm架构下的.so文件,这样可以?

可以, 我一直都是这么做的。

单独啦出来交叉编译,Makefile要怎么修改或者./configure怎么设置?

最近编辑记录 605364021 (2018-12-07 11:24:56)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn