Operating System - HP-UX
1832992 Members
2501 Online
110048 Solutions
New Discussion

Re: Create a DLL like in Windows

 
Mauro_8
Frequent Advisor

Create a DLL like in Windows

I created a DLL to access ingres database with Visual C++ and I have now to make it portable to HP-UX10.20. With this DLL I send the name of the database and the query and this DLL returns a text file with the result of the query. How can I create the same DLL for HP-UX ? Am I have to compile the source with "cc -Aa" and some more option ? How can I force it to be a dinamic linked library ?

Cheers,
Mauro
2 REPLIES 2
Mark Greene_1
Honored Contributor

Re: Create a DLL like in Windows

When you did the dll for the windows environment, was the ingress database also on that windows server, or where you accessing the db on another server via a socket connection or something else like ODBC?

I ask because if the ingress db is actually running on the HP server, you shouldn't need to go through all the trouble of a C program, you should be able to do a simple shell script or stored procedure if this is going to be run locally. If you need to have this proccess run by a client, I'd again look at either a stored procedure for the db on the HP system, or making use of the same type of db connetion on the client (sockets, odbc, jdbc, etc) and using a simliar type of approach from the client side.

HTH
mark
the future will be a lot like now, only later
Steven Gillard_2
Honored Contributor

Re: Create a DLL like in Windows

Its unlikely that this is going to be as simple as recompiling on hpux, but you can create a shared library as follows:

1. Create PIC (position independant) object code by using the +z option to the compiler

2. Generate a shared library by using the -b option to the linker (ld).

For more information have a read of the linker and libraries guide:

http://docs.hp.com/hpux/onlinedocs/B2355-90654/B2355-90654.html

Regards,
Steve