Run LibModbus examples on Linux

Asked by Nenad Milasinovic

Hi,

When i compile some exmaple and try to run executable file, i receive message:
./random-test-slave: error while loading shared libraries: libmodbus.so.2: cannot open shared object file: No such file or directory
Any ideas why this happens?

Thanks in advance.

Question information

Language:
English Edit question
Status:
Answered
For:
libmodbus Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Stéphane Raimbault (sra) said :
#1

/etc/ld.so.conf.d/*

/etc/ld.so.conf.d/libc.conf
# libc default configuration
/usr/local/lib

# ldconfig

If you compile with Autotools (./configure & make),
./random-test-slave (in tests) is just a script able to dynamic load
the required lib (so your pb is strange).
You can also try to use the provided PPA.

https://launchpad.net/~sra/+archive

Revision history for this message
Steven Hsu (sintsu1101) said :
#2

The same problem occurs to me, after I use launchpad deb install libmodbus, the problem is solving.

Revision history for this message
Steven Hsu (sintsu1101) said :
#3

Such question happens to ubuntu but centos won't

Revision history for this message
Martin Mohan (martinmohan) said :
#4

I got the same error on ubuntu 10.04.
Make sure you run ldconfig with root permission.
sudo ldconfig

To check libmodbus is installed
sudo ldconfig -v | grep libmodbus

Revision history for this message
sebastian pizarro (nelyafinwe) said :
#5

On Archlinux,
Create file /etc/ld.so.conf.d/libc.conf (must be root)
Edit file /etc/ld.so.conf.d/libc.conf (must be root)
    Add /usr/local/lib
    Save File
Run ldconfig as root.

Revision history for this message
Stéphane Raimbault (sra) said :
#6

LinkedIn
------------

I'd like to add you to my professional network on LinkedIn.

- Stéphane Raimbault

Stéphane Raimbault
Open Source Project Leader and Software developer at Makina Corpus
Nantes Area, France

Confirm that you know Stéphane Raimbault
https://www.linkedin.com/e/-rlighj-gl2146fh-57/isd/2469859667/qoXyl0Br/

--
(c) 2011, LinkedIn Corporation

Can you help with this problem?

Provide an answer of your own, or ask Nenad Milasinovic for more information if necessary.

To post a message you must log in.