Qt error cannot find -lQtCore -lQtGui -lQtTest -QtOpenGl -lcore on linux ubuntu 16.04 - c++

I am using Qt 5.12.2 on a linux ubuntu 16.04 and when I execute a program I get an error saying that it is not finding -lQtCore, -lQtGui, -lQtTest, -lQtOpenGl and -lcore and I also get
collect2 error: ld returned 1 exit status.
What can i do to fix this?
I have already tried solving this using the command sudo apt-get install libglu1-mesa-dev and sudo apt-get install mesa-common-dev

It appears that you do not have the Qt5 libraries installed on your system. The libraries are included with the Qt Creator runtime, so it can always find them. When you run an executable outside of Qt Creator, you must (typically) copy the libraries required to the folder where the executable has been placed.
Check out the details in the docs.
https://doc.qt.io/qt-5/linux-deployment.html

Related

fatal error: 'openssl/evp.h' file not found cmake + make

Operating system: macOS Catalina
I have a project that has a file called CMakeLists.txt. I ran cmake and then make, but the make command failed:
/Users/blablabla/Downloads/myproject/src/main.cpp:10:10: fatal error:
'openssl/evp.h' file not found
#include <openssl/evp.h>
I tried reinstalling OpenSSL via homebrew, linking the libraries but it still gave this error.
What am I could be doing wrong?
Any help would be highly appreciated
either openssl's dev library is not installed, or the g++ command that cmake generates probably is missing a -I.
try sudo apt-get install libssl-dev first and if that doesn't work, make sure the openssl include dir is provided to g++.
according to https://cmake.org/cmake/help/v3.6/module/FindOpenSSL.html, it creates an env var of OPENSSL_INCLUDE_DIR
edit: just noticed you're on OSX. you can install the the dev libssl package with brew install openssl

Qt examples fail to run on Ubuntu

I am beginner on Qt,i just installed the last version with Qt creator.
I choose Calculator example or create new Application and when i build i always got the same errors:
cannot find -lGL
collect2: error: ld returned 1 exit status.
Could someone help me to overcome those errors?
Thank you
As the docs is pointed out in ubuntu you have to install the following:
sudo apt-get install build-essential libgl1-mesa-dev

Fedora V-Play on Qt: cannot find libraries

I am new for VPlay, after I installed V-Play with Qt and I wrote a simple project, and I got error message after compiling:
error: cannot find -lpulse-mainloop-glib
error: cannot find -lpulse
error: cannot find -lglib-2.0
But I tried:
sudo dnf install pulseaudio-libs
sudo dnf install glibs2
It shows that I already installed these libraries, but the result of compiling still the same.
What packages I should install now?
Try installing pulseaudio-libs-devel and glib2-devel.

compiling code with opencv - /usr/bin/ld: cannot find -lippicv

When compiling some code with opencv I get this error
# g++ txtbin-03.1.cpp -o txtbin `pkg-config opencv --cflags --libs`
/usr/bin/ld: cannot find -lippicv
collect2: error: ld returned 1 exit status
installing opencv
# apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
# apt-get install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
# cd /var/bin && git clone https://github.com/Itseez/opencv.git && cd opencv
# cmake . && make -j2 && make install
In my case, all it took was to copy libippicv.a from the OpenCV SDK to /usr/local/lib:
sudo cp 3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/libippicv.a /usr/local/lib/
Recompiling whole library isn't necessary, especially if you don't need this library. I found great and instantly working solution here. In case link expired or broke:
The solution is simply to remove -lippicv from opencv pkg-config configuration file. So you have to locate opencv.pc file, which default is in /usr/local/lib/pkgconfig/ directory. Then from section Libs: just remove aforementioned library.
Recompile OpenCv using following option:
cmake -DWITH_IPP=ON . && make -j $(nproc) && make install
libippicv.a is a third party library, so you need to explicitly provide it during compilation or make it part of your execution environment.
It is located in ~/OpenCV/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/
Also, provide cmake -DWITH_IPP=ON at the time of Makefile generation.
I was running into the same problem while trying to install the opencv_contrib repository (opencv-3.1.0/Ubuntu 16.04), and none of the solutions worked (I tried to make OpenCV with flag WITH_IPP=ON, but somehow OpenCV 3.1.0 failed to download the ippicv library(?) and there was no error prompt so I only figured this out when I tried to locate ippicv in terminal).
My solution was to download another OpenCV build (3.0.0 worked for me), make + make install with flag WITH_IPP=ON, and then copy the downloaded ippicv library (which should be located in /usr/local/share/OpenCV/3rdparty/lib/libippicv.a by now) to /usr/local/lib/.
I don't know if this is a known bug in OpenCV 3.1.0, but this one is definitely worth keeping an eye out for.

Problem building Festival (Text to Speech) on Ubuntu

I set up a Ubuntu VM today just to build Festival on Ubuntu (I never ran it before) Then I did the following setups
On the Terminal window I wrote following to install GNU C++ Compiler
sudo apt-get install build-essential
To test the g++ I wrote a sample hello world and compiled it using g++ and run it and it worked as expected.
I downloaded all the files from listed on festival download page
Unpacked all to the home directory(~) using
tar -zxvf *.tar.gz
Then wrote following 3 commands to configure and make speech_tools
cd speech_tools
./configure
make
But make returns with following errors
/lib -leststring -lcurses -ldl -lncurses -lm -lstdc++ -lgcc
/usr/bin/ld: cannot find -lcurses
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make[1]: *** [ch_lab] Error 1
make: *** [main] Error 2
What am I missing? being a newbie to Ubuntu or any other Unix platform I may missed some important configuration, before that I have successfully built festival on my windows machine using Cygwin.
You probably need to install the development packages for libncurses. Try
sudo apt-get install libncurses5-dev