Qt examples fail to run on Ubuntu - c++

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

Related

Can't build Firebird SQL on Oracle Linux 8 Ampere V1 (arm64) [duplicate]

I'm following the Matlab coder kalman tutorial in Matlab help. When using codegen, there's an error as below:
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
But there is libstdc++.so.6 in /lib/ and /usr/lib
For Fedora 16 use:
sudo yum install libstdc++-static
You can soft link the library to the name that is being sought
ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so
i did sudo apt-get install g++-4.7 it work for me for matlab .
If you're compiling a 32-bit application on a 64-bit CentOS 7:
sudo yum install libstdc++-devel.i686
For CentOS, be sure you have installed gcc-c++ package (it includes libstdc++-devel dependency):
sudo yum install gcc-c++

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

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

Qt on Centos 7 with OpenGl not working

I have installed Qt on a CentOS 7 machine following the recommendation of QT documentation:
sudo yum groupinstall "C Development Tools and Libraries"
sudo yum install mesa-libGL-devel
a real nightmare as "C Development Tools and Libraries" does not exist. I have found and installed "Development Tools": manually as the groupinstall does not work!
I managed to run Qt creator but whenever I try to build and run any C++ application I got a cascade of errors:
:-1: error: skipping incompatible
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when
searching for -lGL
:-1: error: skipping incompatible /lib/libGL.so when searching for
-lGL
:-1: error: skipping incompatible /usr/lib/libGL.so when searching for
-lGL
:-1: error: cannot find -lGL
:-1: error: collect2: error: ld returned 1 exit status
I need to run the OpenGl library as my application requires the use of the Three libraries. Did anybody successfully installed Qt and OpenGL on a CentOS 7 operating system?
Install the devtoolsets-6 package and make sure you start qtcreator from a shell where you have enabeled devtoolsets 6. Then you'll have a modern dev environment. Also make sure you have installed the NVidia drivers (or AMD equivalents) for proper OpenGL support.

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.

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