详细解决方案
Solaris 10 x86虚拟机上编译动态连接库的有关问题
热度:3466 发布时间:2013-02-26 00:00:00
solaris 10x86 u6、虚拟机环境下编译动态连接阿库的问题:
c/c++代码为:
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <unistd.h>
int abc(int a, int b)
{
return a + b;
}
int my_socket()
{
return socket(PF_INET, SOCK_STREAM, 0);
}
编译命令行:
gcc -shared -o 123.so 123.cpp -lsocket -lnsl
编译结果:
文本重定位持续 引用的
针对符号 位移 在文件中
__xnet_socket 0x1c /var/tmp//cchdeuju.o
ld: 致命的: 重定位仍旧与可分配但不可写的节相反
collect2: ld returned 1 exit status
请问改如何解决,谢谢了
------解决方案--------------------------------------------------------
http://bbs2.chinaunix.net/viewthread.php?tid=946354
参考这个
------解决方案--------------------------------------------------------
gcc -fPIC -c 123.c
gcc -shared -o 123.so 123.o
相关解决方案
- 求 WAS v6.1 for solaris,解决思路
- 求 WAS v6.1 for solaris,该怎么处理
- 在 Oracle Solaris 11.1 中施用命名和目录服务
- solaris 10 网络怪异有关问题: 必须拔上网线再插下才能通
- Solaris 10 x86虚拟机上编译动态连接库的有关问题
- solaris undefined symbol解决方案
- sun solaris 10 ftp 能下传不能上载和修改。便在cmd上面就可以
- Oracle 10g client for Solaris,该怎么解决
- solaris 配备
- Solaris 10上安装SUNWI15CS SUNWI1CS出错(急)
- solaris IO 一般么
- solaris 十 修改 pipe size
- 想用Virtual PC虚构UNIX,求Solaris 10 ,Solaris 10 for x86版或已经设置好的虚拟文件
- solaris 10 上怎么bind ugen
- solaris 命令中返回下一级菜单是?
- Solaris 十 u10 编译Qt 4.7.5 备记
- solaris 自动备份脚本,该怎么解决
- Solaris 10 有没有支持32位的?该如何处理
- Solaris Sparc 九 中文乱码解决
- solaris 的hostname能带点吗?该怎么处理
- solaris 十 装好后有多大
- 求 solaris 日常操作管理的电子书,多谢
- Solaris 网络IP设立
- solaris 10sparc 下没有perl,如何从网下安装
- Solaris 上面date的命令不能使用date -d要用什么代替
- 急求 Solaris 九 x86!
- solaris 10 上用OCCI操作oracle 10g链接出错!
- SOLARIS 上怎么卸载ORACLE10G
- (Solaris、Aix、Hp-ux) 跟 Suse 操作命令有那些区别
- helpwhy my solaris users do not have its own dirctory ?解决方案