1

I had a project which uses libudev and libusb libraries.

Operating System: Ubuntu 18.04 64-bit

Initially the application was 64-bit, so there was no issue.

Now, there is a new requirement of supporting 32-bit. When i tried to compile by adding -m32 to my build Makefile, it throws the following error.

/usr/bin/ld: cannot find -ludev
/usr/bin/ld: skipping incompatible //usr/lib/x86_64-linux-gnu/libusb-1.0.so when searching for -lusb-1.0
/usr/bin/ld: skipping incompatible //usr/lib/x86_64-linux-gnu/libusb-1.0.a when searching for -lusb-1.0
/usr/bin/ld: cannot find -lusb-1.0
collect2: error: ld returned 1 exit status

I used the following commands to install 64-bit versions:

sudo apt-get install libudev-dev
sudo apt-get install libusb-1.0-0-dev

I tried the following command but it didn't work

sudo apt-get install libudev1:i386

What is the command to install 32-bit version of these libraries?

1

You need to install the i386 development packages:

sudo apt install libudev-dev:i386 libusb-1.0-0-dev:i386

These two are co-installable with their amd64 versions so you won’t need to uninstall anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.