i4gl problem in HP getting a library
Posted in 2007
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Licensing & Editions, Platform-Specific Issues
Hi all;
system is uname -a
HP-UX crux B.11.00 U 9000/800 12345678 unlimited-user license
and
i4gl -V IBM INFORMIX-4GL Version 7.32.FC2 Software Serial Number
RDS#0000000
I have a library :-
/home/it/user_dev/Lib/liba.a :-
-rw-r----- 1 user_dev cssprd 175032 Nov 15 13:45 liba.a
My program:-
MODIFY PROGRAM: 4GL Other Libraries Compile_Options Rename Exit
----------------------- syspgm4gl -------------- Press CTRL-W for Help
--------
Program [sdna ]
4gl Source 4gl Source Path
[sp_dsc_na ] [ ]
Other Source Ext Other Source Path
[ ] [ ] [ ]
Libraries [a ] Compile Options [ ]
Compiling returns:-
The following errors were discovered during compilation.
ld: Can't find library or mismatched ABI for -la
Fatal error.
Yup - I know this is probably an `ld` problem and have the environment
set to:-
LDPATH=/home/it/user_dev/Lib/:/opt_local/infx/current/lib:/opt_local/
infx/current/lib/esql:/opt_local/infx/current/lib/tools:/usr/lib
LD_LIBRARY_PATH=sameLPATH=same
SHRPATH=same
LIB_PATH=same - all I can work out.
So command line, `ld sp_dsc_na.o -la`
ld: Can't find library or mismatched ABI for -la
Fatal error.
Its years since I did any `ar` stuff, so I was wandering what the ABI
means !
Or am I not making the library correctly:-
ar -tv /home/it/user_dev/Lib/a.a
rw-r----- 1376/ 1000 3488 Nov 8 12:45 2007 fgiuser.o
rw-r----- 1376/ 1000 2248 Nov 8 12:45 2007 fgiusr.o
. . . . .
which seems OK to me !!
I note the c4gl defaults to "shared", so perhaps my library IS wrong
Also the file generated using all .0 files rather than the libarary
turns out to be:-
sdna.4ge: ELF-64 executable object file - PA-RISC 2.0 (LP64)
So !!
Any Ideas please.
Regards
Ian
ian wrote:
> Hi all;
>
> system is uname -a
> HP-UX crux B.11.00 U 9000/800 12345678 unlimited-user license
> and
> i4gl -V IBM INFORMIX-4GL Version 7.32.FC2 Software Serial Number
> RDS#0000000
>
> I have a library :-
> /home/it/user_dev/Lib/liba.a :-
> -rw-r----- 1 user_dev cssprd 175032 Nov 15 13:45 liba.a
>
> My program:-
> MODIFY PROGRAM: 4GL Other Libraries Compile_Options Rename Exit
> ----------------------- syspgm4gl -------------- Press CTRL-W for Help
> --------
> Program [sdna ]
> 4gl Source 4gl Source Path
> [sp_dsc_na ] [ ]
> Other Source Ext Other Source Path
> [ ] [ ] [ ]
> Libraries [a ] Compile Options [ ]
>
> Compiling returns:-
> The following errors were discovered during compilation.
> ld: Can't find library or mismatched ABI for -la
> Fatal error.>
> Yup - I know this is probably an `ld` problem and have the environment
> set to:-
> LDPATH=/home/it/user_dev/Lib/:/opt_local/infx/current/lib:/opt_local/
> infx/current/lib/esql:/opt_local/infx/current/lib/tools:/usr/lib
> LD_LIBRARY_PATH=same> LPATH=same
> SHRPATH=same
Isn't it SHLIB_PATH on HP ?
> LIB_PATH=same - all I can work out.
>
> So command line, `ld sp_dsc_na.o -la`
> ld: Can't find library or mismatched ABI for -la
> Fatal error.
-la would be looking for a file called "liba.sl"
.a files are archives, of many .o files, not a librarys.
You should be able to just: c4gl foo.4gl bar.a -o foo
The ABI mismatch could be to do with trying to mix 32 and 64 bit objects.
>
> Its years since I did any `ar` stuff, so I was wandering what the ABI
> means !
> Or am I not making the library correctly:-
> ar -tv /home/it/user_dev/Lib/a.a
> rw-r----- 1376/ 1000 3488 Nov 8 12:45 2007 fgiuser.o
> rw-r----- 1376/ 1000 2248 Nov 8 12:45 2007 fgiusr.o
> . . . . .
> which seems OK to me !!
>
> I note the c4gl defaults to "shared", so perhaps my library IS wrong
> Also the file generated using all .0 files rather than the libarary
> turns out to be:-
> sdna.4ge: ELF-64 executable object file - PA-RISC 2.0 (LP64)
> So !!
>
> Any Ideas please.
>
> Regards
> Ian
ian wrote:
> system is uname -a
> HP-UX crux B.11.00 U 9000/800 12345678 unlimited-user license
> and
> i4gl -V IBM INFORMIX-4GL Version 7.32.FC2 Software Serial Number
> RDS#0000000
>
> I have a library :-
> /home/it/user_dev/Lib/liba.a :-
> -rw-r----- 1 user_dev cssprd 175032 Nov 15 13:45 liba.a
>
> My program:-
> MODIFY PROGRAM: 4GL Other Libraries Compile_Options Rename Exit
> ----------------------- syspgm4gl -------------- Press CTRL-W for Help
> --------
> Program [sdna ]
> 4gl Source 4gl Source Path
> [sp_dsc_na ] [ ]
> Other Source Ext Other Source Path
> [ ] [ ] [ ]
> Libraries [a ] Compile Options [ ]
>
> Compiling returns:-
> The following errors were discovered during compilation.
> ld: Can't find library or mismatched ABI for -la
> Fatal error.>
> Yup - I know this is probably an `ld` problem and have the environment
> set to:-
> LDPATH=/home/it/user_dev/Lib/:/opt_local/infx/current/lib:/opt_local/
> infx/current/lib/esql:/opt_local/infx/current/lib/tools:/usr/lib
> LD_LIBRARY_PATH=same> LPATH=same
> SHRPATH=same
> LIB_PATH=same - all I can work out.
>
> So command line, `ld sp_dsc_na.o -la`
> ld: Can't find library or mismatched ABI for -la
> Fatal error.>
> Its years since I did any `ar` stuff, so I was wandering what the ABI
> means !
> Or am I not making the library correctly:-
> ar -tv /home/it/user_dev/Lib/a.a
> rw-r----- 1376/ 1000 3488 Nov 8 12:45 2007 fgiuser.o
> rw-r----- 1376/ 1000 2248 Nov 8 12:45 2007 fgiusr.o
> . . . . .
> which seems OK to me !!
>
> I note the c4gl defaults to "shared", so perhaps my library IS wrong
> Also the file generated using all .0 files rather than the libarary
> turns out to be:-
> sdna.4ge: ELF-64 executable object file - PA-RISC 2.0 (LP64)
> So !!
>
> Any Ideas please.
I dislike 'either/or' errors - it is so much better to have separate
messages for the separate alternatives.
If the problem is the ld can't find the library, maybe you need to add
'-L.' as an extra option, to pick up the library from the current
directory. Or replace '.' with the absolute name of the directory
containing liba.a.
If the problem is mismatched API, it means that your C compiler is
exepcting to find 64-bit object files but the library contains 32-bit
object files - or possibly vice versa. You can start diagnosing this by
running 'file ...' on various object files - those extracted from (or
built into) liba.a, those built by c4gl, and those in the I4GL libraries.
If your library file is actually named a.a, then that will not be found
by the -la option; when you specify -la, the linker/loader will look for
files liba.sl and liba.a (and not a.a). That's why the file for the GCC
bootstrap library is called libiberty.a -- it is linked using '-liberty'.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2007.0914 -- http://dbi.perl.org/
publictimestamp.org/ptb/PTB-1845 ripemd320 2007-11-22 03:00:04
BCDDFB83E477DE6214CE763864724C65AAB086FE59F252713EF33CC08DDE800C023D68
23079166F
On Nov 21, 11:35 pm, Jonathan Leffler <jleff...@earthlink.net> wrote: > I dislike 'either/or' errors - it is so much better to have separate > messages for the separate alternatives. I'm going a bit offtopic here but, I'd like to manifest how much I dislike those kinds of errors too, and sadly Informix seems to have its share of them. It's difficult to me to understand that a more precise diagnostic cannot be made. I hope that could be fixed. -- Gerardo Santana