I Have a project that uses QT Bluetooth and i managed to compile it up until today
Today when calling QMake I get
Project MESSAGE: Warning: unknown QT: bluetooth
the .pro file looks something like this:
######################################################################
# Automatically generated by qmake (3.0) Thu Sep 29 10:34:51 2016
######################################################################
QT += bluetooth
QT += core
QT -= gui
CONFIG += c++11
CONFIG += debug
TEMPLATE = app
TARGET = build/ankioverdrive
#INCLUDEPATH += .
LIBS += -lmosquittopp
LIBS += -L/usr/lib
INCLUDEPATH += /usr/include/
# Input
SOURCES += some/paths/to/files.cpp \
HEADERS += \
some/paths/to/files.h \
running qmake --version which seemd to be the problem for some before gave me
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
I'm on Kubuntu 18.04
I fixed the Problem by reinstalling Qt via the qt-unified install tool for linux, and running the qmake file in that installPath
PathToInstallation/version/gcc_64/bin/qmake
this worked
Related
I am creating a GUI app with Qt creator to communicate with an esp32 and control the outputs. I am currently using Qt 6.4 version, I know lib is not available in 6.0 or 6.1 but I couldn't find anything on 6.4.
This pages advices to input QT += serial port; https://doc.qt.io/qt-6/qtserialport-index.html. In my Qt app my.pro file I declare this:
QT += core gui serialport
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = serialRead
TEMPLATE = app
CONFIG += c++17
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
mainwindow.h
FORMS += \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
Error Message:
:-1: error: Project ERROR: Unknown module(s) in QT: serialport
I still dont know what to do to be able to use the QSerialPort library. I would appreciate any guidance. Thank you!
I solved the same issue with https://wiki.qt.io/Qt_Serial_Port
Install Perl (i.e Strawberry Perl)
Clone the qtserialport repo
git clone git://code.qt.io/qt/qtserialport.git
cd qtserialport
Checkout to suitable branch (you can list present branches with "git branch -a")
git checkout remotes/origin/6.3.1
Open qtserialport project with Qt Creator via CMakeLists.txt
In the "Projects" tab find "Build Steps" group, expand "Details" and check "install"
Rebuild the project from menu "Build->Rebuild"
It would be installed automatically. You may check it in the "Compile output". Note, that you have to rebuild the project for each build configuration you need.
Hope it will helps.
Use the application QT Maintenance Tool to add serialport lib.
I am using Qt 5.15.2 and Win10 64-bit
I have just downloaded the GLFW source package from the original site, not the pre-compiled binaries. I do not know how to compile it with Qt. Then I would like to use it in Qt.
I know that there are pre-compiled binaries but those can use only in Visual Studio.
I know that there is an integrated QtOpenGL to Qt but I would like to use the "original" OpenGL.
Edit:
I downloaded the 64-bit GLFW package.
The files location C:/LIBS/glfw, folder contain the following files: glfw3.dll, glfw3dll.a, libglfw3.a, glfw3.h
.pro file
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += \
main.cpp
LIBS += -LC:/LIBS/glfw/ -lglfw3
INCLUDEPATH += C:/LIBS/glfw
DEPENDPATH += C:/LIBS/glfw
You don't have to compile the GLFW source package. The precompiled binary package contains binaries for both Visual Studio and MinGW.
You have to link the OpenGL binary, so your LIBS line in the .pro file should be:
LIBS += -LC:/LIBS/glfw/ -lglfw3 -lopengl32
And you may also have to append -lglu32 and/or -lgdi32 if you still get some additional link errors.
I have some trouble to generate a release folder in QtCreator 4.7.2 based on Qt 5.11.2 (MSVC 2015, 32 bit). My program runs just fine in the debug version, but when I change the build to the release version, I get compiler errors.
I use the QCustomPlot library inside my application, and somehow in the release build it does not like
integerPart > 0 ? QString::number(integerPart)+QLatin1String(" ") : QLatin1String("")
which throws me a C2446: ':': no conversion from 'QLatin1String' to 'QStringBuilder'
So I replaced the line for testing with
integerPart > 0 ? "" : ""
and so the compiler throws no more errors, but now I get a LNK1158: cannot run 'rc.exe'
I tried to clean the build and run qmake, but the linker error does not disappear. Any Ideas what could cause this problems? I only switched from debug to release.
Edit:
#-------------------------------------------------
#
# Project created by QtCreator 2018-11-09T09:59:59
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
TARGET = PlotterApp
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += QT_USE_QSTRINGBUILDER
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
CONFIG += c++11
QT += serialport
SOURCES += \
main.cpp \
mainwindow.cpp \
serialporthandler.cpp \
qcustomplot.cpp \
parameterobject.cpp
HEADERS += \
mainwindow.h \
serialporthandler.h \
qcustomplot.h \
parameterobject.h
FORMS += \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
Go to this folder
C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86
and copy rc.exe and rcdll.dll to the following folder
X64
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64
X86
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
I have problems with setting up Qt with opencv:
With Qt5 cMake unable to finish the configuration. Luckily with Qt4 it works fine. (default only Qt)
mingw32-make
mingw32-make install
(this runs without error)
But when I use InputVideo which is in highgui, it stops runtime.
Checking with dependecy walker, the LIBOPENCV_HIGHGUI246.DLL has dependecies like:
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
...
these are in theory part of windows8. How can i fix this problem?
(besides moving all dll-s near my executable)
I managed to configure a Qt Creator project with OpenCV to run a simple OpenCV application I wrote recently, named cvDisplacementMapFilter.
I tested it with OpenCV 2.4.7 on Mac OS X 10.7.5 and OpenCV 2.4.2 on Windows 7. I believe the following .pro file can help you:
SOURCES += \
main.cpp
# On my system I have to specify g++ as compiler else it will use clang++ by default
QMAKE_CXX=g++
QMAKE_CC=gcc
## OpenCV settings for Unix/Linux
unix:!mac {
message("* Using settings for Unix/Linux.")
INCLUDEPATH += /usr/local/include/opencv
LIBS += -L/usr/local/lib/ \
-lopencv_core \
-lopencv_highgui \
-lopencv_imgproc
}
## OpenCV settings for Mac OS X
macx {
message("* Using settings for Mac OS X.")
INCLUDEPATH += /usr/local/include/opencv
LIBS += -L/usr/local/lib/ \
-lopencv_core \
-lopencv_highgui \
-lopencv_imgproc
}
## OpenCV settings for Windows and OpenCV 2.4.2
win32 {
message("* Using settings for Windows.")
INCLUDEPATH += "C:\\opencv\\build\\include" \
"C:\\opencv\\build\\include\\opencv" \
"C:\\opencv\\build\\include\\opencv2"
LIBS += -L"C:\\opencv\\build\\x86\\vc10\\lib" \
-lopencv_core242 \
-lopencv_highgui242 \
-lopencv_imgproc242
}
Don't forget to change the paths and version of OpenCV at win32.
Is there any way to integrate Qt and Physx so i can use Physx inside Qt Creator?
Unfortunately PhysX is compiled against the /MT (static run-time version), while Qt MSVC uses /MD. Meaning you will have to build a Qt MSVC static build with /MT. Even if you get it to run using Qt's shared version you will run into the following warning and possible problems:
defaultlib 'LIBCMT' conflicts with use of other libs...
This stackoverflow answer will help you get you started for a qt static build: How to build Qt 4.8/5.2 statically under VS2012, using the static MSVC runtime, with Windows XP support?
To use the PhysX library with Qt MSVC (MinGW is not compatible with PhysX), here's an example qmake configuration.
PHYSX = /path/to/physx/library
INCLUDEPATH += $${PHYSX}/Include
LIBS += -L$${PHYSX}/Lib/win64
LIBS += \
-lPhysX3CharacterKinematic_x64 \
-lPhysX3_x64 \
-lPhysX3Common_x64 \
-lPhysX3Cooking_x64 \
-lPhysX3Extensions \
-lPhysX3Vehicle \
-lPhysXProfileSDK \
-lPhysXVisualDebuggerSDK \
-lPxTask