There are some environment variables that need to be imported, but do not want to import them manually, so you can write a shell script to import, for
example, in export_lib.sh
-Cpp code
1
export LD_LIBRARY_PATH=./lib
If you run ./export_lib.sh directly, you cannot If the import is successful, you need to use the command source export_lib.sh to execute.
After execution, use the command
-Bash code
1
echo $LD_LIBRARY_PATH
example, in export_lib.sh
-Cpp code
1
export LD_LIBRARY_PATH=./lib
If you run ./export_lib.sh directly, you cannot If the import is successful, you need to use the command source export_lib.sh to execute.
After execution, use the command
-Bash code
1
echo $LD_LIBRARY_PATH
you can see the effect