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.
jerussaAsked:
Who is Participating?
 
rbrConnect With a Mentor Commented:
Pls give more info!
0
 
ahoffmannCommented:
sounds that ther is no path to libnotes.so .
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.
0
 
rbrCommented:
Pls look at your LIBPATH and at the places where these paths points to. Look if you have this library.  
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
jerussaAuthor Commented:
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/sunspa
INCNOTES = -I/usr/lotus/notescpp/include
PROCPLSFLAGS= SQLCHECK=FULL CODE=CPP LINES=YES DBMS=V6
PROCINC=SYS_INCLUDE=/usr/include SYS_INCLUDE=/usr/ucbinclude SYS_INCLUDE=/opt/ars/api/include SYS_INCLUDE=/usr/local/include/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-solaris2.5.1/include \
      -I/usr/ucbinclude/sys -I/usr/lib/locale/C/LC_CTYPE $(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

0
 
ahoffmannCommented:
Try the -rpath and -rpath-link options for ld. For example in you makefile:

LDFLAGS = (all what is still there) -rpath $(LIBNOTES)
0
 
jerussaAuthor Commented:
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)"
0
 
ahoffmannCommented:
ahh, you're using g++ as linker ;-)
Use:

      LDFLAGS = ... -Wl,-rpath,$(LIBNOTES)

BTW, did ldd show you the right libnotes.so path?
0
 
jerussaAuthor Commented:
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 ...
0
 
ahoffmannCommented:
could you please add
  -v -Wl,-v

to CPPFLAGS and then post the output.

BTW, still waiting for ldd result.
0
 
jerussaAuthor Commented:
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-solaris2.5.1/include \
     -I/usr/ucbinclude/sys -I/usr/lib/locale/C/LC_CTYPE $(INCNOTES)

It´s rigth, say me to email and i send the output file.
0
 
jerussaAuthor Commented:
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/include
 /usr/local/include/g++
 /usr/local/include
 /usr/local/sparc-sun-solaris2.6/include
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/cc1plus /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/sparc-sun-solaris2.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/sparc-sun-solaris2.6/2.8.1/crt1.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/crtbegin.o -L/usr/ar/api/lib -L/usr/local/lib -L/usr/ucblib -L/usr/lib -L/usr/lotus/notes/4610/sunspa -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1 -L/usr/local/sparc-sun-solaris2.6/lib -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/sparc-sun-solaris2.6/2.8.1/crtend.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.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/include/g++: cannot execute"


0
 
ahoffmannCommented:
Oops, didn't know that Solaris' ld has no more -v option.

-Wl,-v  is useless (produces the error), sorry.

hoagascht@gmx.net
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.