Hi,
I am porting an application from Ingres II 2.5 on a Sun Sparc Solaris
2.6 machine to Ingres II 2.6 on a Sun Sparc Solaris 9 machine. When I
try to build the application the follwing compile fails with the
following symbol refencing conflicts between libingres.a(dlos.o) and
libdl.so.1
COMPILE COMMAND:
cc -w -o /users/itpdevel/revsuper/dev/deliv/loadcode/_exe/loadcode
BS-5b95.c \
-I${TUXDIR}/include -L${TUXDIR}/lib loadcode.o tpwrap.o writerrs.o
fmldef.o \
getopt.o objattr.o prefix.o codesvc.o str.o dataconv.o fmlfunc.o
oroad.o sqldafn.o \
-L/software/tuxedo/tuxedo8.1/lib
/software/itpdevingres/ingres/lib/libingres.a \
-lm -lc -lelf -ltux -lbuft -lfml -lfml32 -lengine -R/usr/lib/lwp
-lpthread -lposix4 -lsocket -lnsl
ERROR:
Undefined first referenced
symbol in file
dlerror
/software/itpdevingres/ingres/lib/libingres.a(dlos.o) (symbol belongs
to implicit dependency /usr/lib/libdl.so.1)
dlclose
/software/itpdevingres/ingres/lib/libingres.a(dlos.o) (symbol belongs
to implicit dependency /usr/lib/libdl.so.1)
dlopen
/software/itpdevingres/ingres/lib/libingres.a(dlos.o) (symbol belongs
to implicit dependency /usr/lib/libdl.so.1)
dlsym
/software/itpdevingres/ingres/lib/libingres.a(dlos.o) (symbol belongs
to implicit dependency /usr/lib/libdl.so.1)
ld: fatal: Symbol referencing errors. No output written to
/users/itpdevel/revsuper/dev/deliv/loadcode/_exe/loadcode
QUESTIONS:
Can anyone tell me how to avoid this conflict seeing as libdl.so.1 is
an implicit dependency of the Sun Solaris linker and so beyond my
control?
If I exclude libigres.a and instead extract and link the various
libraries can I do without dlos.o and if so what object files do I
require for a program with simple database access such as connect,
basic SQL, prepare and execute statements and cursors?
Thanks,
Damien.
Karl & Betty Schendel - 20 Jan 2004 19:00 GMT
>Hi,
>
[quoted text clipped - 3 lines]
>following symbol refencing conflicts between libingres.a(dlos.o) and
>libdl.so.1
[snip]
Simply adding -ldl to your link string should solve it.
Another thing you might try (in general, won't do anything to help this
particular problem) is to link with:
eval cc -o output {.o list} `cat $II_SYSTEM/ingres/files/abflnk.opt` {-l list}
where the .o list are your objects, and the -l list is your libraries
as well as system libraries. For any given platform you can usually figure
out the base set of -l's needed by looking at
$II_SYSTEM/ingres/files/utld.def
using the abflnk.opt as indicated will link libq and friends as shared
libraries, instead of dragging in all of libingres.a. You'll get smaller
binaries, which is a plus if there are lots of them.
Karl
Michael A Leo - 20 Jan 2004 19:22 GMT
Damien,
Just add
-ldl -lrt
to the list of link libraries.
How did I figure this out?
I don't honestly know. Just a hunch based on my past readings
of really interesting groups like comp.programing.threads and
comp.sources.sun. If you have insomnia, these are great groups
to read.
Cheers,
Mikey
>Hi,
>
[quoted text clipped - 46 lines]
>Thanks,
>Damien.