我们使用具有库路径详细信息(使用-L选项编译)的makefile创建了模块的可执行文件。该路径中存在所有必需的库,并将其设置为LD_library_path环境变量。但在dbx中运行可执行文件时,仍会出现以下错误。

  dbx MsgServer
  For information about new features see `help changes'
  To remove this message, put `dbxenv suppress_startup_message 7.2' in your .dbxrc
  Reading MsgServer
  Reading ld.so.1
  ld.so.1: MsgServer: fatal: libcp.so: open
  failed:       No such file or directory
  terminating signal 9 SIGKILL

我不想搞清楚这些库为什么没有链接。这是ldd的输出。
    ldd MsgServer
    libcp.so =>      (file not found)
    libftux.so =>    (file not found)
    libfldap.so =>   (file not found)
    libfdmq.so =>    (file not found)
    libfbsafe.so =>  (file not found)
    libdmq.so =>     /opt/messageq/lib/libdmq.so
    libmqic.so =>    /usr/lib/libmqic.so
    libsocket.so.1 => /usr/lib/libsocket.so.1
    libc.so.1 =>     /usr/lib/libc.so.1
    libnsl.so.1 =>   /usr/lib/libnsl.so.1
    libdl.so.1 =>    /usr/lib/libdl.so.1
    libCstd.so.1 =>  /usr/lib/libCstd.so.1
    libCrun.so.1 =>  /usr/lib/libCrun.so.1
    libm.so.1 =>     /usr/lib/libm.so.1
    libw.so.1 =>     /usr/lib/libw.so.1
    libthread.so.1 => /usr/lib/libthread.so.1
    libmqmcs.so =>   /usr/lib/libmqmcs.so
    librt.so.1 =>    /usr/lib/librt.so.1
    libmqiz.so =>    /opt/mqm/lib/libmqiz.so
    libmp.so.2 =>    /usr/lib/libmp.so.2
    libaio.so.1 =>   /usr/lib/libaio.so.1
    /usr/platform/SUNW,Sun-Fire/lib/libc_psr.so.1
    /usr/lib/cpu/sparcv8plus/libCstd_isa.so.1

任何帮助都将不胜感激。

最佳答案

您的ldu LIBRARY路径是否已导出?你需要把它出口出去。

07-25 20:53