Problem creating shared library under Solaris 2.6

Problem creating shared library under Solaris 2.6

Post by bbre.. » Sat, 22 Jan 2000 04:00:00



Hello,

I've created a shared library (libsec.so) under Solaris 2.6 using the
SPARCworks C compiler.  I've compiled with the -G and -Kpic options.

The compile completes without errors and creates the libsec.so.

However, when I try to call a function in the library from another
program, I get the following error:

ld.so.1: ./test: fatal: relocation error: file ./test:
symbol getData: referenced symbol not found

An nm of the library shows that the function (getData())
does exist:

[Index]   Value      Size    Type  Bind  Other Shndx   Name

[59]    |      5024|      68|FUNC |GLOB |0    |7      |getData

I've searched the FAQ and posts on comp.unix.programmer but haven't
found any answers.

Any help appreciated.

Thanks,

Braun Brelin

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Problem creating shared library under Solaris 2.6

Post by Rainer Temm » Sat, 22 Jan 2000 04:00:00



> I've created a shared library (libsec.so) under Solaris 2.6 using the
> SPARCworks C compiler.  I've compiled with the -G and -Kpic options.

> The compile completes without errors and creates the libsec.so.

> However, when I try to call a function in the library from another
> program, I get the following error:

> ld.so.1: ./test: fatal: relocation error: file ./test:
> symbol getData: referenced symbol not found

> An nm of the library shows that the function (getData())
> does exist:

> [Index]   Value      Size    Type  Bind  Other Shndx   Name

> [59]    |      5024|      68|FUNC |GLOB |0    |7      |getData

Hi bbrelin,

How did you link your main-program (./test) ? Did you specify -lsec ?

Regards Rainer

 
 
 

1. Problem Making Shared Object Library for Xpm on Solaris 2.6:

I have been trying with little success to make a shared object library for Xpm
in Solaris 2.6. I downloaded source and makefiles from ftp.x.org. The README
file claims that this version (4.7) makes both static and shared libraries. My
experience leads me to believe otherwise. Are there some compile switches I need
to set in order to get shared objects? What about the settings for ar?

Thanks in advance for your help.

I will check this group for replies; please email replies to:



as well.

Thanks

Corwin Zechar

2. To ELF or not to ELF ...

3. Problems creating shared libraries (Solaris)

4. Linux Counter: 57104 registered Linux users

5. JNI: Creating shared libraries on Solaris

6. ATI Video.

7. Creating a shared library using gcc on Solaris?

8. samba problem

9. How to create a shared library for Solaris?

10. Problem making Shared Object for Xpm in Solaris 2.6

11. Exabyte 230D Tape Library Problem w/Networker 5.2.1 (Solaris 2.6)

12. library building problem on Solaris 2.6

13. Exabyte 230D Tape Library Problem w/Networker 5.2.1 (Solaris 2.6)