Sponsored Content
Full Discussion: Compiling with Dll in HP Ux
Top Forums Programming Compiling with Dll in HP Ux Post 302145229 by porter on Tuesday 13th of November 2007 10:45:22 AM
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..
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
nlist_ia(3C)															      nlist_ia(3C)

NAME
nlist_ia: nlist(), nlist64() - get entries from name list on Integrity systems SYNOPSIS
Command: [flag]... [library]... Remarks The use of symbol table type and value information is inherently nonportable. The use of or should reduce the effort required to port a program that uses such information, but complete portability across all HP-UX implementations cannot be expected. This manpage describes and for Itanium-based systems. For and on PA-RISC systems, see nlist_pa(3C). DESCRIPTION
and have basically the same functionality and they can process SOM or ELF files. The structure is the same as and is used for source code compatibility. The or function examines the name list in the executable file whose name is pointed to by file_name, and selectively extracts a list of values and puts them in the array of structures pointed to by nl. The array of structures initially contains only the names of variables. Once the or function has been called, the variable names are augmented with symbol information. The list is terminated by a null name, which consists of a null string in the variable-name position of the structure. The name list of the file is searched for each variable name. If the name is found, the symbol's type, scope, and value in the file is inserted into the name list structure. If the file searched is an ELF file, the section index is also inserted. For SOM files, the subspace index is inserted. The symbol value is 64-bit. If the file searched is a SOM file, then the value field is zero padded. If the name is not found, the fields in the name list structure are set to 0. The structures and are defined in the include file See a.out(4) and nlist(4) for further description of the symbol table structure. The file must have the organization and symbol table described for an file in a.out(4). The information is extracted from the symbol table used by the linker, ld(1). On machines that have such a file, this subroutine is useful for examining the system name list kept in file In this way programs can obtain system addresses that are up to date. RETURN VALUE
All structure fields are set to 0 if the file cannot be found or if it is not a valid object file containing a linker symbol table. and return: An error occurred. Success. WARNINGS
The header file is automatically included by for compatibility. However, including is discouraged if the only information needed from is for use by or If is included, the line may need to follow it. SEE ALSO
ld(1), elf(3E), a.out(4), nlist(4). STANDARDS CONFORMANCE
Integrity Systems Only nlist_ia(3C)
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy