Header File and DLL Reference Errors Reported After Calling an Interface
Symptom
- Header file error: "fatal error: hmpp.h: No such file or directory"
- 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
- 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.
- 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
- 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.
- Add environment variables.
- Open /etc/profile.
1vi /etc/profile - 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 - Press Esc, type :wq!, and press Enter to save the file and exit.
- Open /etc/profile.
- Make the settings take effect.
1source /etc/profile
Parent topic: Troubleshooting