Rate This Document
Findability
Accuracy
Completeness
Readability

Header File and DLL Reference Errors Reported After Calling an Interface

Symptom

  1. Header file error: "fatal error: hmpp.h: No such file or directory"
  2. Dynamic-link library (DLL) reference error: "./test: error while loading shared libraries: libHMPP_core.so.xxxx: cannot open shared object file: No such file or directory"

xxxx indicates the version number.

Key Process and Cause Analysis

  1. The installation package may not be correctly installed. The header file and DLL of the HMPP library are not stored in the respective target directories.
  2. After the installation package is installed, the environment variables are not properly written into the system and thus do not take effect.

Conclusion and Solution

  1. Check whether the header file and dynamic library exist in /usr/local/include/HMPP and /usr/local/lib/HMPP respectively. If not, install them again.
  2. Add environment variables.
    1. Open /etc/profile.
      1
      vi /etc/profile
      
    2. Add the following environment variables to the file:
      export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include/HMPP
      export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/include/HMPP
      if [ ! -n "$LD_LIBRARY_PATH" ]
      then
              export LD_LIBRARY_PATH=/usr/local/lib/HMPP
      else
              export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/HMPP
      fi
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Make the settings take effect.
    1
    source /etc/profile