|
|
|
|
 gcc编译问题,大家过来看看,一起探讨一下。 - sunf2002 [ 2006-03-15 09:42 | 891 byte(s)]
 Re: gcc编译问题,大家过来看看,一起探讨一下。 - EricFisher [ 2006-03-15 16:50 | 59 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
我使用
gcc 3.3.6
gcc -fpic ......
gcc -shared .....
会抱错:DP relative code in file /var/tmp//ccoLWv3d.o - shared library must be position
independent. Use +z or +Z to recompile.
我查了资料好像在HP-UX上只能用ld来连接 共享库文件,
所以我该用
ld -b......
这是会导致全局对象无法初始化,再查阅gcc资料发现有这样的话
(1) On some systems, `gcc -shared' needs to build supplementary stub
code for constructors to work. On multi-libbed systems, `gcc -shared'
must select the correct support libraries to link against. Failing to
supply the correct flags may lead to subtle defects. Supplying them in
cases where they are not necessary is innocuous.
可是不是很理解,不知如何解决。
请问哪位高手知道解决方法。
|
|
|
[Original]
[Print]
[Top]
|
|
|