2

I am currently trying to test a c++ code I wrote on Qt, and I downloaded libudev and it keeps giving a lot of "undefined reference to". I followed almost all of the posts of upgrading libudev,

sudo apt-get install libudev0:i386
sudo ln -sf /lib/$(arch)-linux-gnu/libudev.so.1 /lib/$(arch)-linux-gnu/libudev.so.0

and this post .Error from this:

dpkg: error processing archive libudev0_175-0ubuntu9_amd64.deb
dkpk: error processing archive libudev0_175-0ubuntu9_amd64.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
libudev0_175-0ubuntu9_amd64.deb

I haven't had any luck yet. Most of the time I get "directory does not exist" errors. Would this have to do with my Ubuntu version?

5
  • Have you installed libudev-dev and setup its linking in Qt project.
    – user.dz
    Oct 29, 2018 at 12:24
  • @user.dz I have download libudev-dev. How do I set up its linking in Qt project?
    – miceandmon
    Oct 29, 2018 at 17:15
  • Check stackoverflow.com/questions/718447/… , I'm not sure about default paths and how Qt handle flags but -I, -l, -L should be the same for any c++ compiler.
    – user.dz
    Oct 29, 2018 at 17:34
  • 1
    Got it. I added CONFIG += link_pkgconfig DEFINES += LINK_LIBUDEV PKGCONFIG += libudev to my .pro file and it worked. THANKS
    – miceandmon
    Oct 29, 2018 at 23:47
  • That's nice, it does support pkgconfig .. that's new to me. Would you please write an answer to to the question.
    – user.dz
    Oct 30, 2018 at 6:43

1 Answer 1

3

Got it. I added CONFIG += link_pkgconfig DEFINES += LINK_LIBUDEV PKGCONFIG += libudev to my .pro file and it worked

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .