how to set qwt path or environment variable

2019-08-29 10:09发布

问题:

I have installed qwt and include the path

INCLUDEPATH += /usr/local/qwt-6.0.0-rc5/include

LIBS += -L/usr/local/qwt-6.0.0-rc5/lib -lqwt

in my profile.

But when I run my program i get the error

error while loading shared libraries: libqwt.so.6: cannot open shared object file: No such file or directory /home/cv/abc/abc exited with code 127

When using terminal I set the path

export LD_LIBRARY_PATH=/usr/local/qwt-6.0.0-rc5

Then when I run the program (using the play button of the interface) I am still getting an error. I don't know where I'm wrong, I'm totally stuck. Can someone explain me in detail how to make qwt work with qt? Does version make any difference? Please explain me in detail I shall be very thank full!

I am using ubuntu 10.04.

Thanks

回答1:

  1. You can install qwt in ubuntu way

    aptitude install libqwt-dev

  2. Also in qtreator you can specify Run Enviroment for your project. Select Projects in left panel and goto Run Setting.



回答2:

Did you add the path to Qwt to the run-time linker?

In /etc/ld.so.conf.d/ create a file qwt.conf where you just write the path to [your-qwt-path]/lib.

EDIT: You will, of course, need root privileges to create a file there. Also, I forgot to mention you will need to sudo ldconfig after creating that file. Lastly, it didn't work until I rebooted my system. :)



标签: c++ linux qwt