The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
re-compiling aViking UNIX for Advanced & Expert Users 5 03-21-2006 07:44 AM
compiling with aix 5.1 n-may AIX 1 05-24-2004 11:17 PM
compiling Blunt_Killer High Level Programming 1 09-28-2001 08:10 PM
compiling qt nydel UNIX for Dummies Questions & Answers 2 08-03-2001 05:14 PM
compiling nydel UNIX for Dummies Questions & Answers 3 08-02-2001 10:28 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-13-2007
Registered User
 

Join Date: Nov 2007
Posts: 12
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?
Reply With Quote
Forum Sponsor
  #2  
Old 11-13-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
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 09:08 AM.
Reply With Quote
  #3  
Old 11-13-2007
Registered User
 

Join Date: Nov 2007
Posts: 12
Thks a lot.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0