I can't compile my project in QT - c++

I've installed QT on my virtual machine running Ubuntu and started a new project but when I try to compile and run it I get this error:
"Configuration is faulty. Check the Issues view for details.
Error while building/deploying project PoshetPOP3 (kit: Desktop Qt 5.5.1 GCC 64bit)
When executing step "Make" "
Issues view says :"QT Creator needs a compiler set up to build.Configure a compiler in the kit options"
*"PoshetPOP3" my project name.
I also have QT installed on my host machine(windows 10) and it works perfectly.
Why do I get it and how can I fix this error?
An answer would be much apreciated,thank you!

Somehow I managed to work it out by doing this:
sudo apt-get install g++
sudo apt-get install qt4-dev-tools
And then restart the QT.Sorry for the poor research.

Related

Error during project compilation in QT [duplicate]

I just reinstalled QtCreator, created new project (Qt Application) an got this after compilation:
/usr/bin/ld: **cannot find -lGL**
collect2: error: ld returned 1 exit status
make: *** [untitled1] Error 1
18:07:41: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled1 (kit: Desktop Qt 5.1.0 GCC 32bit)
When executing step 'Make'
(Project is empty, I did'n commit any changes)
Qt Creator 2.7.2
Based on Qt 5.1.0 (32 bit)
Ubuntu 13.04
How do I solve this problem?
You should install package "libgl1-mesa-dev":
sudo apt install libgl1-mesa-dev
you don't need to install anything. libGL is already installed with Ubuntu, you just need to soft link it. (tested for ubuntu 14.x and 15.x, might work for later versions)
First locate the GL library
Then link it under /usr/lib
If the library is missing, it can be installed via libgl1-mesa-dev package
Here is how you could do this:
$ locate libGL
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10.0
/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10
/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10.0
/usr/lib/x86_64-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
$ sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so
The gui Qt module is included by default. If you don't want to use it in a project (e.g., it is a library or only uses stdio), you need to specify that in the .pro file.
QT -= gui
And the linker won't attempt to find lGL regardless of whether it is installed.
My case is admittedly a bit odd, since the main reason to use Qt is to create gui's. Installing the GL library is certainly not difficult, I just wanted to know why my quick and dirty Hello World wanted it.
write:
yum provides */libGL.so
after providing:
yum install mesa-libGL-devel mesa-libGLU-devel
This worked for me:
sudo ln -s /usr/lib/libEGL1.so /usr/lib/libGL.so
My system is Ubuntu 16.04 on x86 computer(with NVIDIA GeForce GPU).
Check the library files located in /usr/lib/x86_64-linux-gnu
ls -al /usr/lib/x86_64-linux-gnu/libG*
If you see the broken link, reinstall libgl1-mesa-glx
sudo apt install --reinstall libgl1-mesa-glx
And, recheck library.
In my case: I have installed QT 32 bit lib in Win10 64 bit and it ran into error, I change to all 64 bit and QT creator run smoothly.
Solved this problem just a minute ago in suse.
Just do the following step below and QTCreator should works just fine.
sudo zypper install --type pattern devel_basis

Qt on beagle bone black (full install not cross-compile)

I want to use qt on beagle bone black same as we use on desktop without "cross compiling" and "tool chain" stuff. I already done this for raspberry pi running raspbian wheezy using
apt-get install qtcreator
command. I searched on google and found something called qt embedded for BBB. I followed
opkg update
opkg install qt4-embedded --force-depends
opkg install libqtcoree-dev libqtguie-dev
instructions and installed qt embedded on BBB running Armstrong on it.
Now i have a project developed on my desktop in qt creator and i want to build it on BBB. I am searching for this from last two days with no success, all i found eveywhere is "cross compile" and "tool chain". Does anyone knows how to build qt project on BBB natively (whether it is possible or not?)?
I copied my folder containing qt project on Armstrong desktop.
Then i go in directory
cd Desktop/DisplayPara
and tried
qmake DisplayPara.pro
it only shows somthing like this
sh: -d:command not found
sh: -d:command not found
I tried
qmake -project DisplayPara.pro
which also end up with same error. I don't know what's going wrong ? any help, suggestions will appreciated. Thanx...
I didn't have any luck with those instructions either.
I removed all Qt packages and did:
opkg install qt4-embedded
opkg install qt4-embedded-dev
Then in the directory with my application I did:
source /usr/share/qtopia/environment-setup
qmake -project
qmake
make
Exit gnome (or other desktop). I just use Ctrl-Alt-F1 to get to a console window.
Then run:
./myapp -qws
The -qws flag makes the application run under its own Qtopia server.
I would like to be able to run under the Gnome desktop environment, but this is the only way I could get something that works.
Hints welcome.

Qt 5.1.1 compiler setup on Ubuntu

First of all, I should point out that I've never used linux before.
I have a clean install of 64bit ubuntu, I downloaded Qt 5.1.1 for linux 64 bit from http://qt-project.org/downloads, ran the .run file, installed it and gcc which is included in that download, opened Qt Creator, made a new project and tried to compile it. It wont compile and I keep getting this error message
:-1: error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options.
I added a gcc compiler, but what do I need to put for the compiler path, platform codegen flags, platform linker flags and ABI?
You don't have to input the path of your compiler because gcc and g++ paths are available in the $PATH enovironment variable. So just use "gcc" and "g++" and that should work. Just make sure you restart Qt Creator after the installation of g++.
One more thing. You need a compiled version of Qt installed on your computer. So also install Qt libraries with
sudo apt-get install qt4-dev-tools
If you want to use the new version of the library you have to add it to $PATH. You can do this in the terminal with
export PATH=/path/to/Qt/qtbase:$PATH
And then run Qt Creator from the same terminal, in which you did the last command.
Good luck!
You will have to install the dependencies as well. I got it working when I followed the steps in the following link.
Try this:
http://wiki.qt.io/Building_Qt_5_from_Git

The process "mingw32-make.exe" crashed Error

I have downloaded qt-windows-opensource-5.0.1-mingw47_32-x86-offline.exe and installed on my system, after that i launched QT Creator and tried to run a QML based example (shipped example is "QtQuick Examples - MouseArea" which tried, and below problem comes with any example i try to run) which was supplied with along with the whole package.
When i try to run the project i get below log...
13:00:20: Running steps for project mousearea...
13:00:20: Configuration unchanged, skipping qmake step.
13:00:20: Starting: "mingw32-make.exe"
qtcreator_ctrlc_stub: Command line failed: mingw32-make.exe
13:00:20: The process "mingw32-make.exe" crashed.
Error while building/deploying project mousearea (kit: Desktop Qt 5.0.1 MinGW 32bit)
When executing step 'Make'
Do you have mingw47_32 installed? The Qt you download needs the very same compiler the Qt libraries where compiled with, and that is the one that appears in the name of the download.
So my guess is that you're compiling with some other mingw which is not version 4.7 / 32 bits. Download that version, point Qt to it in Tools >> Options >> Kits. Rebuild then.
The problem was resolved later on, I installed qt-windows-opensource-5.0.1-mingw47_32-x86-offline.exe on 64bit system and that's why mingw32-make.exe crashed, downloading appropriate QT for 64bit system solve the problem.

QT Project unable to compile, no compiler available to build

I'm running Mountain Lion and I've installed QT Library 4.8
From this page...
Qt libraries 4.8.4 for Mac (185 MB)
I've also installed Qt Creator 2.6.1 for Mac (Intel 32/64bit) (51 MB) from the same page.
When I attempt to run, I get this error:
18:14:01: Could not start process "make" -w Error while
building/deploying project WebBrowser (target: Desktop) When executing
step 'Make'
I will include my build setup in three screenshots
Any ideas?
It seems like you didn't install the UNIX command line tools package of XCode. Install that and it should work. See here on how to install the UNIX tools in XCode:
https://stackoverflow.com/a/9329325/856199
There are also stand-alone versions of the UNIX command line development tools if you don't want to install XCode. You can find them here:
https://developer.apple.com/downloads/index.action
Look for "Command Line Tools (OS X Mountain Lion) for XCode". Get the latest version.