• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

Error executing C++ binary

hi all,

i am able to compile my program successfully, but when i execute the binary, encounter error.

exec(): 0509-036 Cannot load program XXX because of the following errors:
rtld: 0712-001 Symbol shc_edc_init was referenced
      from module /XXX/YYY/ZZZ/AAA/lib/libodbslib.a(shr.o), but a runtime definition
      of the symbol was not found.
rtld: 0712-001 Symbol shc_edc_get_batchid was referenced
      from module /XXX/YYY/ZZZ/AAA/lib/libodbslib.a(shr.o), but a runtime definition
      of the symbol was not found.

i think this is not due to the program error.
please advice and thank you in advanced.
0
gagajanice
Asked:
gagajanice
  • 3
2 Solutions
 
theKashyapCommented:
Problem is that the .so file that defines / provides / implements those symbols is not in your LD_LIBRARY_PATH. Add it.
If you donno but are able to guess which directory might contain that lib then use nm -C. E.g.
for xlib in `find <lib dir> -name *.so -type f `
do
    nm -C $xlib | grep -q shc_edc_
    [ $? -eq 0 ] && echo $xlib has a hit
done

Open in new window

0
 
gagajaniceAuthor Commented:
hi theKashyap,

i did an echo of the LD_LIBRARY_PATH and the library path for libodbslib.a(shr.o) is in there.

i tried the for loop you provide, i got this error "find: 0652-009 There is a missing conjunction"
for xlib in `find . -name * -type f`
do
        nm -C $xlib | grep -q shc_edc_
        [ $? -eq 0 ] && echo $xlib has a hit
done

FYI, i am not working in a new env and i copied libodbslib from old env.
I can run the binary with no problem.
0
 
GnarfCommented:
Maybe the lib in question has additional dependencies. If these additional libraries can not be found, your requested library can not be loaded.

Look for those dependencies and add the missing libraries to your path.

HTH
Gnarf
0
 
theKashyapCommented:
i did an echo of the LD_LIBRARY_PATH and the library path for libodbslib.a(shr.o) is in there.
You have misread the error. It says that libodbslib.a is the one that wants/uses the symbol. It does NOT provide/define it.
So the symbol is in some other lib.

for xlib in `find . -name * -type f`
Never seen such an error from find.. :-)
Though I can clearly see that you've not copied pasted correctly. I've given "-name *.so" whereas you've typed "-name *"
In any case see that shell variable expansion doesn't hamper the command so make it "-name \*.so" and try again.
0
 
theKashyapCommented:
btw, what's your environment? What compiler what OS?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now