Configuring Qt 5.9.5 on Ubuntu 16.04 - qt

I recently started working with Qt. I was trying some simple widgets. It was working as intended with no errors and suddenly Qt doesn't work anymore. I did not change any configuration/settings. I restarted my computer and I started to get the following error. I have no idea how to fix them.
Error (when trying to open an already existing project):
/Qt/5.9.5/gcc_64/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
Project ERROR: Library '' is not defined.
Warnings while parsing QML type information of Qt/5.9.5/gcc_64/qml:
/Qt/5.9.5/gcc_64/qml/builtins.qmltypes:1:24: Reading only version 1.1 parts.
/Qt/5.9.5/gcc_64/qml/builtins.qmltypes:10:5: Expected only Component and ModuleApi object definitions.
/Qt/5.9.5/gcc_64/mkspecs/features/qmake_use.prf(6): 'take_first' is not a recognized replace function.
Project ERROR: Library '' is not defined.
/Qt/5.9.5/gcc_64/mkspecs/features/toolchain.prf(69): system(execute) requires one or two arguments.
Project ERROR: Cannot run compiler 'g++'. Output:
===================
===================
Error (when trying to create a new project)
Maybe you forgot to setup the environment?
Error while parsing file /workspace/testQt/testQt.pro. Giving up.
/Qt/5.9.5/gcc_64/mkspecs/features/toolchain.prf(69): system(execute) requires one or two arguments.
Project ERROR: Cannot run compiler 'g++'. Output:
===================
===================
Other details:
Qt version: Qt 5.9.5(gcc_64)
Compilier: GCC 7.3.0
OS: Ubuntu 16.04.4 LTS
PS: I had this same error two days back. Reinstalling Qt fixed it but not anymore.
There is no problem with g++. I complied a code with the same complier (used here) through terminal and it works perfectly.
Thank you.

I had the same problem, and I solved it by upgrading QtCreator. I think, 3.x.x versions of QtCreator incorrectly assumes the name of g++ compiler. In Kits options there is only "Compiler" setting, and in 4.x.x there are two separate string "C" and "C++". After indicating correct paths to both compiles "Cannot run compiler" error disappears.

Related

CentOS 7 - Qt creator can't parse .pro files

Qt creator is exhibiting this behavior on a fresh installation of CentOS 7:
Once a .pro file is opened, this message is displayed, and the project fails to load:
/usr/lib64/qt5/mkspecs/features/toolchain.prf(70): system(execute requires one or two arguments.
Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment?
Error while parsing file /online/RCCARS/compass-rccars-daq/compass-rccars-daq-master/Master.pro. Giving up.
Upon googling a bit, I found that commenting out the following line:
load(toolchain)
In this file:
/usr/lib64/qt5/mkspecs/features/default_pre.prf
solves this issue. After doing this, I can once again open projects, as well as compile and run them without any issues.
I checked the g++ path as well, it is correct and in fact points to a g++ compiler.
The question is, why does this happen? Could commenting the line out have any negative effects? Are there any alternative solutions?

Portaudio library not working with Qt

I have successfully installed and used the Portaudio library for real time sound output on Ubuntu, with some C++ code.
But my main project is on Windows under Qt Creator. I have tried to build Portaudio with MinGW which seems to have worked because when I run the example "bin/paex_sine" it outputs a sine, but I can't use it in Qt.
I have linked the library by adding
LIBS += -LC:/MinGW/lib/ -lportaudio.dll
as advised there, but I get errors of this type :
undefined reference to mingw_initcharmax crtexe.c
I also tried to use the flag "--enable-cxx" when running ./configure, but then the make returns the following error :
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwtype:89:11: error: '::iswblank' has not been declared
using ::iswblank;
^
I don't really know what I did wrong and how I should proceed...

Architect / StatET: Launching R Console was cancelled because R engine failed

I recently upgraded to Architect version 0.9.7 on my Win 7 machine. However, after starting Architect, the RJ console wouldn't launch and I got the error message:
‘Launching the R Console was cancelled, because It seems starting the R engine failed.”
Please make sure that R package 'rj' (2.0 or compatible) is installed and
that the R library paths are set correctly for the R environment
configuration 'Embedded R Server'.
I installed the packages ‘rj’ and ‘rj.gd’ through the RTerm run console (which does happen to work) within Architect using the command suggested on www.walware.de:
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-2.0")
Then, I restarted windows, and restarted Architect. Same error message. I zoomed in on the details of the error message and noticed the following line:
SEVERE: Path to rj package not found. Use R_LIBS or java property
'de.walware.rj.rpkg.path' to specify the location.
So I opened an RTerm run console to check whether any of my .libPaths() locations contains the directories ‘rj’ or ‘rj.gd’. Oddly enough, they do. My first .libPaths path contains both packages. So that doesn’t seem to be the reason.
How could this be fixed?
I received prompt and helpful feedback from Open Analytics (thanks!), who informed me that the problem is due to changes in Java 8. With Java 7, Architect works fine. The next release of Architect will incorporate the changes in Java 8.
In order to get it work with Java 7, enforce the use of a specific Java Runtime, by using the -vm argument in the architect.ini file as follows:
-vm
C:\Program Files\Java\jre7\bin\javaw.exe
(mind the line break, which is required)
This is particularly useful if you have several Java versions on your system where the default Java is not suitable for use with Architect. The architect.ini file is found directly at the top level of the installation folder of Architect. You can find out where this is by looking at the Properties of the Architect shortcut on your desktop.
N.B. the -vm argument should be put before the -vmargs argument otherwise it is simply ignored!
N.B. examples of -vm specification on GNU/Linux and Mac OS X:
http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Linux_Example
http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Mac_OS_X_Example

Debugging in Codelite (Ubuntu 12.04)

I installed codelite (v4.1.5770) in Ubuntu 12.04.
I find that it cannot build correctly, when the program has errors. It reports them in the process of building, but finally when is finished building, it outputs the message that there is no error.
I've not faced such situation in windows. I changed the building setting but it was useless.
So who can tell me what should I do? Thank you.
codelite uses regular expressions to parse the output produced by the compiler.
It is likely (and this is probably the case) that the error format that the compiler produced simply was not recognized by codelite.
If you could post some of the error messages you got which were not detected as errors / warnings by codelite, I could help you compile a proper regular expressions and instruct you where to place them inside codelite
Eran

Qmake does not specify a valid qt

After installing Qt SDK for Open Source C++ development on Mac OS by following the respective steps
Note for the binary package: If you have the binary package, simply
double-click on the Qt.mpkg and follow the instructions to install Qt.
Yes, that is all I have done to install Qt on MacOsX. Everything was going fine, until I run a sample application, of which compile output resulted in:
No valid Qt version set.
Set one in Preferences
Error while building project qtilk
When executing build step 'QMake'
Canceled build.
Then I tried to change the respective Qt version in Preferences and I hovered over the Path, I realized my mkspec isn't set:
Then I tried querying qmake by qmake -query:
QT_INSTALL_PREFIX:/
QT_INSTALL_DATA:/usr/local/Qt4.6
QT_INSTALL_DOCS:/Developer/Documentation/Qt
QT_INSTALL_HEADERS:/usr/include
QT_INSTALL_LIBS:/Library/Frameworks
QT_INSTALL_BINS:/Developer/Tools/Qt
QT_INSTALL_PLUGINS:/Developer/Applications/Qt/plugins
QT_INSTALL_TRANSLATIONS:/Developer/Applications/Qt/translations
QT_INSTALL_CONFIGURATION:/Library/Preferences/Qt
QT_INSTALL_EXAMPLES:/Developer/Examples/Qt/
QT_INSTALL_DEMOS:/Developer/Examples/Qt/Demos
**QMAKE_MKSPECS:/usr/local/Qt4.6/mkspecs**
QMAKE_VERSION:2.01a
QT_VERSION:4.6.2
QMAKE_MKSPECS seems to be set here??
Will setting my mkspec solve my building problem? I tried setting by typing export mkspec=macx-g++. Still, mkspec seems not to be set to anything. I am all ears waiting for your answers. Thanks in advance.
To set the correct spec, use:
qmake -spec max-g++

Resources