IBM Support

LIBPATH Environment variables for AIX platforms

Education


Abstract

The LIBPATH environment variable tells AIX applications where to find shared libraries when located in a different directories than those specified in the header section of the executable.

Content

If the LIBPATH environment variable is defined, the system loader refers to it in order to search referenced shared objects and libraries that contain shared archive members,when the executable file is invoked.

For example, if the LIBPATH is set to:

LIBPATH=/projectname/lib

The system loader will then search for the referenced shared objects and libraries in the following order:

1./projectname/lib

2. /usr/lib

3. /lib

If a shared object cannot be found by the system loader when trying to start an executable, an error message similar to the following will be seen:

exec(): 0509-036 Cannot load program <exe> because of the following errors:

     0509-022 Cannot load library libxxx.so.

     0509-026 System error: A file or directory in the path name does not exist.

The missing objects will be listed with 0509-022 error messages. To resolve this error, set the LIBPATH environment variable to include the directory that contains the shared object and restart the application.

Ie issue LIBPATH to test your test library as it is not in the default path.

Ex: .LIBPATH=/projectname/<test image>

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
25 November 2019

UID

ibm11098675