急:arm-linux-uclibc-gcc 生存so库,在运用程序调用报错。

xiaoyaoyoudm 2009-09-04 09:39:56
生存库编译如下:
arm-linux-uclibc-gcc avsend.o util.o udp.o ctrlmgr.o -lpthread -L. -shared -fPIC -o libavsend.so
运行程序编译如下:
arm-linux-uclibc-gcc test.o -lpthread -L. -lavsend -lstdc++ -o avsend

但是生成的avsend运行报错如下:
/mnt/tztx $ ./avsend
Can't modify /lib/libavsend.so's text section. Use GCC option -fPIC for shared o
bjects, please.
/mnt/tztx $
很着急啊,摆脱各位大虾帮个忙了。。。。
...全文
133 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhihaining 2009-09-04
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 showman 的回复:]
arm-linux-uclibc-gcc test.o -lpthread -L. -lavsend -lstdc++ -fPIC -o avsend
[/Quote]

Can't modify /lib/libavsend.so's text section. Use GCC option -fPIC for shared o
bjects, please.

写的很清楚了。
steptodream 2009-09-04
  • 打赏
  • 举报
回复
帮顶
xiaoyaoyoudm 2009-09-04
  • 打赏
  • 举报
回复
求助!!!
longhiram 2009-09-04
  • 打赏
  • 举报
回复
帮顶
ShowMan 2009-09-04
  • 打赏
  • 举报
回复
arm-linux-uclibc-gcc test.o -lpthread -L. -lavsend -lstdc++ -fPIC -o avsend
pyh 2009-09-04
  • 打赏
  • 举报
回复
1.你的代码运行的是地址相关还是无关,
2.你生成动态库的语句好像不对,你查一下生成动态库应该怎么写吧

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧