jerussa
asked on
Problems with ld.so.1
I´m working with the Lotus-Notes Api´s to C++. I compile with a "make" including the libraries for this API´s, and I try to run the program, pass this:"ld.so.1: ./conexion: fatal: libnotes.so: can't open file: errno=2 Killed". I had given all trust to the user, rwx, but the error going on.
Pls look at your LIBPATH and at the places where these paths points to. Look if you have this library.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think the makefile isn´t the reason, anyway a put the file on:
TARGET=conexion
SUFFIXES: .pc .c .o
DEFINES = -DUNIX -DSOLARIS -DSOLSPARC
CPPAPI_ID = 0411
LIBNOTES = -L/usr/lotus/notescpp/lib/ sol_2x -L/usr/lotus/notes/4610/su nspa
INCNOTES = -I/usr/lotus/notescpp/incl ude
PROCPLSFLAGS= SQLCHECK=FULL CODE=CPP LINES=YES DBMS=V6
PROCINC=SYS_INCLUDE=/usr/i nclude SYS_INCLUDE=/usr/ucbinclud e SYS_INCLUDE=/opt/ars/api/i nclude SYS_INCLUDE=/usr/local/inc lude/g++
CC=g++
CPPFLAGS= -I/usr/include -I/usr/ar/api/include -I/usr/local/include/g++ -I/usr/lotus/GRI/ARS -I/usr/local/sparc-sun-sol aris2.5.1/ include \
-I/usr/ucbinclude/sys -I/usr/lib/locale/C/LC_CTY PE $(INCNOTES)
LDFLAGS = -L/usr/ar/api/lib -L/usr/local/lib -L/usr/ucblib -L/usr/lib $(LIBNOTES)
LDLIBS = -lc -lar -lnotes -lthread -lm -lnsl -lnts -lsocket -ldl -lposix4 -lcppsun$(CPPAPI_ID)....
like yo can see the libs abaout the notes API´s are in the makefile (-lnotes & -lcppsun$(CPPAPI_ID)
I think that is another problem
TARGET=conexion
SUFFIXES: .pc .c .o
DEFINES = -DUNIX -DSOLARIS -DSOLSPARC
CPPAPI_ID = 0411
LIBNOTES = -L/usr/lotus/notescpp/lib/
INCNOTES = -I/usr/lotus/notescpp/incl
PROCPLSFLAGS= SQLCHECK=FULL CODE=CPP LINES=YES DBMS=V6
PROCINC=SYS_INCLUDE=/usr/i
CC=g++
CPPFLAGS= -I/usr/include -I/usr/ar/api/include -I/usr/local/include/g++ -I/usr/lotus/GRI/ARS -I/usr/local/sparc-sun-sol
-I/usr/ucbinclude/sys -I/usr/lib/locale/C/LC_CTY
LDFLAGS = -L/usr/ar/api/lib -L/usr/local/lib -L/usr/ucblib -L/usr/lib $(LIBNOTES)
LDLIBS = -lc -lar -lnotes -lthread -lm -lnsl -lnts -lsocket -ldl -lposix4 -lcppsun$(CPPAPI_ID)....
like yo can see the libs abaout the notes API´s are in the makefile (-lnotes & -lcppsun$(CPPAPI_ID)
I think that is another problem
Try the -rpath and -rpath-link options for ld. For example in you makefile:
LDFLAGS = (all what is still there) -rpath $(LIBNOTES)
LDFLAGS = (all what is still there) -rpath $(LIBNOTES)
ASKER
I try to compile with the -rpath options and: "g++:-rpath unrecognized options"
I put on the makefile this:
"LDFLAGS = -L/usr/ar/api/lib -L/usr/local/lib -L/usr/ucblib -L/usr/lib -rpath $(LIBNOTES)"
I put on the makefile this:
"LDFLAGS = -L/usr/ar/api/lib -L/usr/local/lib -L/usr/ucblib -L/usr/lib -rpath $(LIBNOTES)"
ahh, you're using g++ as linker ;-)
Use:
LDFLAGS = ... -Wl,-rpath,$(LIBNOTES)
BTW, did ldd show you the right libnotes.so path?
Use:
LDFLAGS = ... -Wl,-rpath,$(LIBNOTES)
BTW, did ldd show you the right libnotes.so path?
ASKER
ld: fatal: file rpath: cannot open file; errno=2
ld: fatal: File processing errors. No output written to conexion
*** Error code 1
make: Fatal error: Command failed for target `conexion'
This is the message that output, what a pity!, this in no so easy and I have to increase the points to ...
ld: fatal: File processing errors. No output written to conexion
*** Error code 1
make: Fatal error: Command failed for target `conexion'
This is the message that output, what a pity!, this in no so easy and I have to increase the points to ...
could you please add
-v -Wl,-v
to CPPFLAGS and then post the output.
BTW, still waiting for ldd result.
-v -Wl,-v
to CPPFLAGS and then post the output.
BTW, still waiting for ldd result.
ASKER
The output is very long, I can send you via e-mail, anyway I put the follow lines like you say me:
CPPFLAGS= -v -Wl,-v -I/usr/include -I/usr/ar/api/include -I/usr/local/include/g++
-I/usr/lotus/GRI/ARS -I/usr/local/sparc-sun-sol aris2.5.1/ include \
-I/usr/ucbinclude/sys -I/usr/lib/locale/C/LC_CTY PE $(INCNOTES)
It´s rigth, say me to email and i send the output file.
CPPFLAGS= -v -Wl,-v -I/usr/include -I/usr/ar/api/include -I/usr/local/include/g++
-I/usr/lotus/GRI/ARS -I/usr/local/sparc-sun-sol
-I/usr/ucbinclude/sys -I/usr/lib/locale/C/LC_CTY
It´s rigth, say me to email and i send the output file.
ASKER
Anyway this is a piece of output:
"#include "..." search starts here:
#include <...> search starts here:
/usr/include
/usr/ar/api/include
/usr/local/include/g++
/usr/lotus/GRI/ARS
/usr/ucbinclude/sys
/usr/lib/locale/C/LC_CTYPE
/usr/lotus/notescpp/includ e
/usr/local/include/g++
/usr/local/include
/usr/local/sparc-sun-solar is2.6/incl ude
/usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/includ e
/usr/include
End of search list.
/usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/cc1plu s /var/tmp/cca0008w.ii -quiet -dumpbase conexion.cc -version -o /var/tmp/cca0008w.s
GNU C++ version 2.8.1 (sparc-sun-solaris2.6) compiled by GNU C version 2.8.1.
/usr/ccs/bin/as -V -Qy -s -o conexion.o /var/tmp/cca0008w.s
/usr/ccs/bin/as: SC4.2 dev 30 Nov 1995
g++: -v: linker input file unused since linking not done
Reading specs from /usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/specs
gcc version 2.8.1
/usr/ccs/bin/ld -V -Y P,/usr/ccs/lib:/usr/lib -Qy -o conexion /usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/crt1.o /usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/crtbeg in.o -L/usr/ar/api/lib -L/usr/local/lib -L/usr/ucblib -L/usr/lib -L/usr/lotus/notes/4610/su nspa -L/usr/local/lib/gcc-lib/s parc-sun-s olaris2.6/ 2.8.1 -L/usr/local/sparc-sun-sol aris2.6/li b -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib interface.o ARSIIL.o ARSFVL.o entryid.o ARS_Utiles.o Lfichero.o Nt_api.o Socket.o conexion.o rpath -L/usr/lotus/notescpp/lib/ sol_2x -lar -lnotes -lthread -lnsl -lnts -lsocket -ldl -lposix4 -lcppsun0411 -v -lstdc++ -lm -lc -lgcc -lc -lgcc /usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/crtend .o /usr/local/lib/gcc-lib/spa rc-sun-sol aris2.6/2. 8.1/crtn.o
ld: Software Generation Utilities (SGU) SunOS/ELF (LK-2.0 (S/I) - versioning)
/usr/ccs/bin/ld: illegal option -- v
usage: ld [-abd:e:f:h:il:mo:rstu:z:B :D:F:GI:L: M:Q:R:S:VY :] file(s)
[-a] create an absolute file
[-b] do not do special PIC relocations in a.out
[-d y|n] operate in dynamic|static mode
[-e sym] use `sym' as entry point address
[-f name] specify library for which this file is an auxiliary
filter
[-h name] use `name' as internal shared object identifier
[-i] ignore LD_LIBRARY_PATH setting
[-l x] search for libx.so or libx.a
[-m] print memory map
[-o outfile] name the output file `outfile'
[-r] create a relocatable object
[-s] strip any symbol and debugging information
[-t] do not warn of multiply defined symbols of
different sizes
[-u sym] create an undefined symbol `sym'
[-z defs|nodefs] disallow|allow undefined symbols
[-z muldefs] allow multiply defined symbols
[-z noversion] don't record any version sections
[-z text] disallow output relocations against text
[-B local] reduce unqualified global symbols to local
[-B dynamic|static]
search for shared libraries|archives
[-B reduce] process symbol reductions
[-B symbolic] bind external references to definitions when
creating shared objects
[-D options] print diagnostic messages
[-F name] specify library for which this file is a filter
[-G] create a shared object
[-I interp] use `interp' as path name of interpreter
[-L path] search for libraries in directory `path'
[-M mapfile] use processing directives contained in `mapfile'
[-Q y|n] do|do not place version information in output file
[-R path] specify a library search path to be used at run time
[-S name] specify a link-edit support library
[-V] print version information
[-Y P,dirlist] use `dirlist' as a default path when searching
for libraries
make: Fatal error: Command failed for target `conexion'/usr/local/inclu de/g++: cannot execute"
"#include "..." search starts here:
#include <...> search starts here:
/usr/include
/usr/ar/api/include
/usr/local/include/g++
/usr/lotus/GRI/ARS
/usr/ucbinclude/sys
/usr/lib/locale/C/LC_CTYPE
/usr/lotus/notescpp/includ
/usr/local/include/g++
/usr/local/include
/usr/local/sparc-sun-solar
/usr/local/lib/gcc-lib/spa
/usr/include
End of search list.
/usr/local/lib/gcc-lib/spa
GNU C++ version 2.8.1 (sparc-sun-solaris2.6) compiled by GNU C version 2.8.1.
/usr/ccs/bin/as -V -Qy -s -o conexion.o /var/tmp/cca0008w.s
/usr/ccs/bin/as: SC4.2 dev 30 Nov 1995
g++: -v: linker input file unused since linking not done
Reading specs from /usr/local/lib/gcc-lib/spa
gcc version 2.8.1
/usr/ccs/bin/ld -V -Y P,/usr/ccs/lib:/usr/lib -Qy -o conexion /usr/local/lib/gcc-lib/spa
ld: Software Generation Utilities (SGU) SunOS/ELF (LK-2.0 (S/I) - versioning)
/usr/ccs/bin/ld: illegal option -- v
usage: ld [-abd:e:f:h:il:mo:rstu:z:B
[-a] create an absolute file
[-b] do not do special PIC relocations in a.out
[-d y|n] operate in dynamic|static mode
[-e sym] use `sym' as entry point address
[-f name] specify library for which this file is an auxiliary
filter
[-h name] use `name' as internal shared object identifier
[-i] ignore LD_LIBRARY_PATH setting
[-l x] search for libx.so or libx.a
[-m] print memory map
[-o outfile] name the output file `outfile'
[-r] create a relocatable object
[-s] strip any symbol and debugging information
[-t] do not warn of multiply defined symbols of
different sizes
[-u sym] create an undefined symbol `sym'
[-z defs|nodefs] disallow|allow undefined symbols
[-z muldefs] allow multiply defined symbols
[-z noversion] don't record any version sections
[-z text] disallow output relocations against text
[-B local] reduce unqualified global symbols to local
[-B dynamic|static]
search for shared libraries|archives
[-B reduce] process symbol reductions
[-B symbolic] bind external references to definitions when
creating shared objects
[-D options] print diagnostic messages
[-F name] specify library for which this file is a filter
[-G] create a shared object
[-I interp] use `interp' as path name of interpreter
[-L path] search for libraries in directory `path'
[-M mapfile] use processing directives contained in `mapfile'
[-Q y|n] do|do not place version information in output file
[-R path] specify a library search path to be used at run time
[-S name] specify a link-edit support library
[-V] print version information
[-Y P,dirlist] use `dirlist' as a default path when searching
for libraries
make: Fatal error: Command failed for target `conexion'/usr/local/inclu
Oops, didn't know that Solaris' ld has no more -v option.
-Wl,-v is useless (produces the error), sorry.
hoagascht@gmx.net
-Wl,-v is useless (produces the error), sorry.
hoagascht@gmx.net
Depending on your OS put path to the lib in LD_LIBRARY_PATH (SHLIB_PATH on HP-UX) environment variable.
Probably you have ldd to check what paths a set in your executable, and which libs will be loaded at startup.