海思linux板子上跑Libevent过程记录

1、libevent下载源码
	https://github.com/libevent/libevent
	github下载libevent.zip,放到vscode的linux docker中
	
2、libevent海思编译器下执行编译安装操作	
	./configure
		./configure --prefix=/usr/local/libevent  --host=arm-linux CC=arm-himix200-linux-gcc --enable-shared --enable-static --disable-openssl
		--prefix:最终的生成的文件放在哪
	make
		问题:test/test_regress-tinytest.o: file not recognized: File format not recognized
		解决:make clean
	sudo make install	
		最终生成的内容:bin  include  lib
3、编译demo
	arm-himix200-linux-gcc LibeventTest3.c -o TestLibeventConnect -L /usr/local/libevent_haisi/lib -levent_core_a -I /usr/local/libevent_haisi/include
    注意:动态库和静态库同时存在时,优先使用动态库,这里的event_core_a是改过名字的.a文件
4、运行demo
	将TestLibeventConnect5移到docker的work目录
		cp TestLibeventConnect /work/nfsroot/yanlong/		(work是服务器的共享盘)
		sync	(同步一下)
		cp /usr/local/libevent/lib/libevent-2.2.so.1* /work/nfsroot/yanlong/
		sync
		ll /usr/local/libevent/lib/
	./TestLibeventConnect5
	error while loading shared libraries: libevent-2.2.so.1: cannot open shared object file: No such file or directory
	/home/yanlong # ln -s libevent-2.2.so.1.0.0 libevent-2.2.so.1 (链接)
	/home/yanlong # ls -al
	添加lib库环境变量:export LD_LIBRARY_PATH=/home/yanlong:$LD_LIBRARY_PATH
	sync


实际开发:
编译源码:root@7fcebd264e66:/work/nfsroot/yanlong# arm-himix200-linux-gcc MDVRConnectClient.c -o MDVRConnect -L /usr/local/libevent_haisi/lib -levent_core_a -I /usr/local/libevent_haisi/include
在板子上运行:./MDVRConnect

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值