Compiling with Dll in HP Ux


 
Thread Tools Search this Thread
Top Forums Programming Compiling with Dll in HP Ux
# 1  
Old 11-13-2007
Compiling with Dll in HP Ux

Hi all,

I had trouble compiling my application with a custom dll, the error appear to be some undefined reference to the functions i had created in my dll. Is there a need to update any environmental variable such as LD_LIBRARY_PATH as in linux system. Please advise.

One more thing is do anyone happen to have a copy of a makefile using c89 compiler?
# 2  
Old 11-13-2007
1. Firstly are you on a SOM(32 bit PA-RISC) or ELF(64 bit PARISC or Itanium2) system2?

if ELF then form is "libXXXX.so[.major[.minor]]

else SOM form is "libXXXX.[sl | [.major[.minor]]]"

2. With HPUX it is very lazy and will happily let you build programs with undefined references.

Compile code position independent

with c89 use "+z"
wiht gcc use "+fPIC"

Building a shared library...

Code:
ld objects[....] \
      -o filename \
      -b \
      +s \
      +b libpaths\
      -B symbolic \
      +h soname \
      +e export [...] \
      -lpthread -lc

I also use "+cdp" to swizzle names of libraries for appropriate directories, so can build in one place and run in another.

With HPUX the path is "SHLIB_PATH" for SOM or "LD_LIBRARY_PATH" for ELF.

-o tells it what file to write to
-b says build a shared library
-B binding options for symbols
+b list of paths to look in when loading
+e exports one symbol, repeat for each symbol
+h like ELF's soname
+s can use environment vars for loading

Last edited by porter; 11-13-2007 at 12:08 PM..
# 3  
Old 11-13-2007
Thks a lot.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Regarding DLL's

hello Forum members, what is internal mechanism of DLL's in Unix kernal.what is the major advantage over static libraries. Thanks & Regards Siva Ranganath (2 Replies)
Discussion started by: workforsiva
2 Replies

2. Shell Programming and Scripting

GD.dll files for php 5.1.6

Hi, I want to create an image dynamically. I used this function. $img_handle = ImageCreate ($length, 10) or die ("Cannot Create image"); It was not creating the image. When i checked in error_log file the error was: PHP Fatal error: Call to undefined function ImageCreate(). ... (0 Replies)
Discussion started by: vanitham
0 Replies

3. Programming

Using Windows DLL in UNIX

Hello, I am sorry to bother you all but I am thinking about switching to UNIX and I am a complete novice there. The problem is that I need to call a C++ dll on UNIX platform which was compiled on Windows. I don't have the source code of the dll as well. I just need to call this dll in my C++... (2 Replies)
Discussion started by: clickoo
2 Replies

4. What is on Your Mind?

Can we run a dll in unix?

I have created DLLs in c++. Is it possible to run these DLLs in unix so that I can save time converting function/scripts in unix? In this way I can reuse these DLL in Unix. Thanks. (2 Replies)
Discussion started by: alestoquia
2 Replies

5. UNIX for Advanced & Expert Users

Executing a .dll from a Unix script

Is it possible for a Unix script to execute a .dll. If so, where would I find information/examples of how to do that? Thanks, in advance, for any help. :rolleyes: (2 Replies)
Discussion started by: BCarlson
2 Replies

6. Programming

How to create .SO file (DLL)

HI, i want to create shared object file (that is .SO file it is similar to DLL in windows)...... Sarwan (3 Replies)
Discussion started by: sarwan
3 Replies

7. IP Networking

dll layer

Hi all , How can I achieve getting the IP address of a local machine, by sending packet over dll layer with its mac address, and how should the frame be consturcted without providing the IP address of the destination machine. Thanx (0 Replies)
Discussion started by: netsavy
0 Replies

8. Solaris

dlopen issue with a dll

HI All, I am trying to use a dll using dlopen but in vain. When I try to ldd that dll it returns no output. Can anybody please tell me how I can load this dll in my process space. PS: ldd -l returns a lot of unsatisfied dependent symbols. Thanks a lot in advance Codeman (0 Replies)
Discussion started by: codeman
0 Replies

9. Programming

Dll

Hello all is there any concept of DLL in UNIX if so mention the name of the library linking dynamically Bye Raj (1 Reply)
Discussion started by: rajashekaran
1 Replies

10. Programming

Need to port C dll to UNIX

I have source code of a Windows C DLL. It complies properly and works. Now I need to port it to UNIX environment. I need to know if I can create a Dynamic Library or only Static Library is possible in UNIX. In case I can create a Dynamic Library please guide me how to proceed. Or if there... (2 Replies)
Discussion started by: ana_puri
2 Replies
Login or Register to Ask a Question