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?

  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]]]"

  1. 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...

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

Thks a lot.