Linux library common FAQ


Q : When starting the application, there will be an error that there is no shared library.

 

A :

The installation may not complete properly. Please install with root privileges.

The shared library doesn't work just by copying it to /usr/local/lib.

To enable the shared library, copy the file to create a symbolic link and then run the ldconfig command.

For more information, please refer to DAQ-LIBMB-LNX/libmodbus/MakeFile.

* Please execute autogen.sh in advance.

 

Q : I want to manage the shared library in any directory.

 

A :

To manage a shared library in any directory, the following two steps are required.

 

1. After specifying prefix=[Any directory (/usr/lib etc.)] in the configure script as shown below, execute make and make install.

With this operation, the shared library will be copied to any directory.

 

# ./autogen.sh

................

# ./configure prefix=Any directory

................

#  make

................

#  make install

 

2. Rewrite /etc/ld.so.conf and execute ldconfig, or add LD_LIBRARY_PATH setting in the shell startup script (Example bash).

The description depends on the shell used. For more information, please check with the man command.

With this operation, the library in any directory will be loaded as a shared library.

 

(Example).bash_profile

LD_LIBRARY_PATH=Any directory

export LD_LIBRARY_PATH

 

Q : Library make fails.

 

A-1 :

Check the Library Specifications to confirm that the architecture and distribution are compatible.

A-2 :

When 32bit "Raspberry Pi OS May 2023" or later is installed on "Raspberry Pi 4 Model B", the OS default setting is 64bit mode.

Therefore, error may occur during make, or, depending on the device driver, device driver may not work properly even if no error occurs during make.

The operation confirmation performed by our company is carried out in 32bit mode.

To operate in 32bit mode, you need to add "arm_64bit=0" to "/boot/firmware/config.txt"(*1) file and reboot OS.

*1: Depending on the environment, it will be "/boot/config.txt"

Please refer https://www.raspberrypi.com/documentation/computers/config_txt.html#arm_64bit to know more details.