Crreating a UDR on HPUX 10.20
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
I have a simple c routine that I am trying to compile into a shared library, but the only examples I can find are for Solaris. The file I am trying to compile is named checkcaps.c. I first issue the following command: >cc -PIC -DMI_SERVBUILD -I/home/informix_udo/incl/public - I/home/informix_udo/incl -L/home/informix_udo/esql/lib -c checkcaps.c This results in a checkcaps.i file. I then issue: >ld -G checkcaps.i -o checkcaps.so This returns the following error: ld: checkcaps.i: Not a valid object file (invalid system id) Any ideas? Sent via Deja.com http://www.deja.com/ Before you buy.
dgmyrs@my-deja.com wrote: > > I have a simple c routine that I am trying to compile into a shared > library, but the only examples I can find are for Solaris. The file I > am trying to compile is named checkcaps.c. > > I first issue the following command: > > >cc -PIC -DMI_SERVBUILD -I/home/informix_udo/incl/public - > I/home/informix_udo/incl -L/home/informix_udo/esql/lib -c checkcaps.c The correct option is -KPIC, not -PIC. -P tells the C pre-processor to produce the .i file; the remainder of the option is probably interpreted as a request to search for include files in a sub-directory C of the current sub-directory, or thereabouts. > This results in a checkcaps.i file. I then issue: > > >ld -G checkcaps.i -o checkcaps.so > > This returns the following error: > > ld: checkcaps.i: Not a valid object file (invalid system id) The .i file is still text -- the pre-processed source code. Lots of blank lines where there used to be #define's and so on. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"
dgmyrs@my-deja.com wrote: > > I have a simple c routine that I am trying to compile into a shared > library, but the only examples I can find are for Solaris. The file I > am trying to compile is named checkcaps.c. > > I first issue the following command: > > >cc -PIC -DMI_SERVBUILD -I/home/informix_udo/incl/public - > I/home/informix_udo/incl -L/home/informix_udo/esql/lib -c checkcaps.c Further to my previous message, isn't the option for producing position independent code on HP-UX something like +z and not anything to do with PIC (-KPIC applies to regulation SVR4 compilers, -fPIC applies to gcc). -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"