Lupdate doesn't work - windows

I'm trying to run lupdate on my .pro file and this is what I see. Nothing happens next and .ts files aren't created. My OS is Win10 as seen from picture. I'm using Qt 5.10.1 with MinGW. Also I've tried to run lupdate on Ubuntu 16.04 and it seems that it works properly. Can somebody please help me with this issue?
QT += quick
QT += quickcontrols2
CONFIG += c++11
CONFIG += console
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked 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 QT_MESSAGELOGCONTEXT
# 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
SOURCES += main.cpp \
shoppinglistmodel.cpp \
loggingcategories.cpp \
logger.cpp \
purchase.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \
shoppinglistmodel.h \
loggingcategories.h \
logger.h \
purchase.h
INCLUDEPATH += "C:\boost_1_66_0"
DISTFILES +=
TRANSLATIONS = sh_lst_ru.ts \
sh_lst_ua.ts

Solution: It seems that if you are using boost libraries in project that should be translated you have to involve TR_EXCLUDE option in your .pro file.
Here's the one from mine, maybe it will help somebody:
TR_EXCLUDE = C:\boost_1_66_0\*

Related

Qt Creator with MinGW 'no match for operator' Error

In order to deploy my project in Windows, I have got the Qt project from Linux and paste all the source files one paste on Windows 7 VM VirtualBox and tried to build it there.
Unfortunately, I am having the following error that I can't find a way to fix. The Qt Creator compiles well the example projects that come with it, but with my project, it pops that errors on MinGW thread header.
In file included from C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/future:39,
from C:\Qt\5.15.1\mingw81_64\include/QtCore/qthread.h:51,
from C:\Qt\5.15.1\mingw81_64\include/QtCore/QtCore:245,
from C:\Qt\5.15.1\mingw81_64\include/QtWidgets/QtWidgetsDepends:3,
from C:\Qt\5.15.1\mingw81_64\include\QtWidgets/QtWidgets:3,
from ..\RaqMed/patientlineedit.h:54,
from ..\RaqMed\addappointmentform.h:13,
from ..\RaqMed\calendar.cpp:4:
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/thread: In function 'bool std::operator==(std::thread::id, std::thread::id)':
C:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/thread:273:26: error: no match for 'operator==' (operand types are 'std::thread::native_handle_type' {aka 'ptw32_handle_t'} and 'std::thread::native_handle_type' {aka 'ptw32_handle_t'})
return __x._M_thread == __y._M_thread;
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
My .pro file:
QT += core gui
QMAKE_CXXFLAGS += -IC:\Users\BRUDEL\Desktop\postgresql\include -fpermissive
QMAKE_LFLAGS += -LC:\Users\BRUDEL\Desktop\postgresql\lib -llibpq
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = RaqMed
TEMPLATE = app
CONFIG += c++11
# 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 += \
addappointmentform.cpp \
addpatientform.cpp \
appointmentwidget.cpp \
bstring.cpp \
calendar.cpp \
edittabmodel.cpp \
main.cpp \
patient.cpp \
patientbdmodel.cpp \
patientdelegate.cpp \
patientlineedit.cpp \
qutils.cpp
HEADERS += \
addappointmentform.h \
addpatientform.h \
appointmentwidget.h \
bstring.h \
calendar.h \
edittabmodel.h \
patient.h \
patientbdmodel.h \
patientdelegate.h \
patientlineedit.h \
qutils.h
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
RESOURCES += \
teste.qrc
FORMS += \
calendar.ui \
testes.ui
DISTFILES += \
capa.png \
icon0.png \
icon2.png
I have installed only the following modules of Qt Creator
Qt 5.15.1
MinGW 8.1.0 64-bit
Qt Charts
Qt Debug Information Files
Developer and Designer Tools
Qt Creator 4.13.1 CDB Debugger Support
Debugging Tools for Windows
MinGW 8.1.0 64-bit
Qt Installer Framework 3.2
CMake 3.17.1 64-bit
Ninja 1.10.0
I have found this similar question with no answer "No match for operator" when including QtSql library in QT
I'm also having these messages when opening Qt Creator
Thanks, and sorry for any posting error, I'm not habituated in English writing.
Edit I already solved the plugin errors by setting the environment variable QT_OPENGL to 'opengl', but the compile error still remain
Edit 2 I copy the thread header file and comment the problem functions, now it's working :)
The problem is exactly in what compiler says:
return __x._M_thread == __y._M_thread;
It doesn't know how to compare objects because operator==() wasn't implemented.
Generally speaking you have two options:
Implement operator== with operator overloading
Find another solution that doesn't involve comparison like this

$$PWD no longer working in Qt Creator 2.6

I have a project (https://github.com/waddlesplash/qtfastjson) that has a .pri file that uses qmake's $$PWD variable. This works fine in all tested versions of qmake, but in Qt Creator 2.6, the files are not displayed in the project tree (but it compiles properly).
Here's the PRI:
QT += core
INCLUDEPATH += $$PWD
HEADERS += $$PWD/QtFastJson.h \
$$PWD/QtFastJsonObject.h
SOURCES += $$PWD/QtFastJson.cpp \
$$PWD/QtFastJsonObject.cpp
which is included from a .pro: include(../src/QtFastJson.pri).
If the $$PWD variables are removed and replaced with relative paths, the files show in the tree.
It seems to work for me in Qt Creator 2.6. Try to place a log immediately before appending to the HEADERS variable:
message($$PWD)
Then check if that path really contains the files you're adding.
Also you can try with the _PRO_FILE_PWD_ variable.

OpenCV 2.4 : problems with includes in Qt in windows

I am not a C++ master (far from that actually), I try to setup an OpenCV + Qt project. I have downloaded the last release of OpenCV. I did nothing more with that (if I understand well, everything is pre-built, so I just have to add the path to the libs in my .pro file).
I added the path to the include folder /opencv/include
That should work that way, since the includes in cv.h, for example, are like that :
include "opencv2/core/core_c.h"
However, when I browse through my opencv folder, opencv2 is empty, there is no core folder in it, nor anything else, actually there is just a header file, opencv.h .
I noticed that all my include are spread into several folders, under the module folder... what should I do??
Thank you very much!
You have to add those libraries in .pro file module wise, means you have to add all modules you are using in the project to LIBS variable in .pro file. Say if you are using modules libopencv1, libopencv2, libopencv3
LIBS += -L/usr/lib -lopencv1 -lopencv2 -lopencv3
like that.
If opencv libraries are added to /usr/local/lib, use -L/usr/local/lib instead of -L/usr/lib
Here is my .pro file :
QT += core gui
TARGET = test_MTI880
TEMPLATE = app
SOURCES += ... ... ...
INCLUDEPATH += D:/PointGreyResearch/FlyCapture2/include \
+= D:/opencv/include
LIBS += D:/opencv/build/x86/vc10/lib/opencv_core240.lib \
D:/opencv/build/x86/vc10/lib/opencv_highgui240.lib \
D:/opencv/build/x86/vc10/lib/opencv_imgproc240.lib \
D:/opencv/build/x86/vc10/lib/opencv_objdetect240.lib \
D:/PointGreyResearch/FlyCapture2/lib/FlyCapture2.lib \
D:/PointGreyResearch/FlyCapture2/lib/C/FlyCapture2_C.lib \
D:/PointGreyResearch/FlyCapture2/lib/FlyCapture2d.lib \
D:/PointGreyResearch/FlyCapture2/lib/FC1/PGRFlyCapture.lib
OK I found the answer...
The right include folder is the one into the build folder ... -_-'

How can I force qtcreator to create non-universal binaries

When I use qtcreator on mac, it creates universal binaries.
Does anyone know how to set it so it just creates a 'native' binary? (So i386' in my case?)
Qtcreator uses qmake as a buildsystem.
Google hasn't been my friend so far, I hope stackoverflow will.
EDIT:
my config file so far:
TARGET = mongowriter
CONFIG += console
CONFIG -= app_bundle
CONFIG += x86
#CONFIG -= ppc
TEMPLATE = app
INCLUDEPATH += /opt/local/include/.
INCLUDEPATH += ../mongodb/.
SOURCES += main.cpp
LIBS += /usr/local/lib/libmongoclient.a
LIBS += /opt/local/lib/libboost_thread-mt.a
LIBS += /opt/local/lib/libboost_filesystem.a
LIBS += /opt/local/lib/libboost_program_options.a
It still gives the error on the libmongoclient.a
The libboost libraries are all ok, but this is because I got them from macports with the +universal option.
Since mongoclient doesn't support universal I'm currently removing all the universal stuff. I was hoping to get 3 errors for the boost libs and that at l;east mongoclient would link.
At that point I could redo the whole macport story again but this time with universal removed.
Unfortunately it seems it still builds a universal binary since I still have the same linker errors.
thanks for the help
you can use the 'CONFIG' variable in your project file to specify which plattforms shall be supported to create a universial binary you use
CONFIG += x86 ppc
if you only need x86 you use
CONFIG += x86

qt in windows7 environment

I am having a problem with running an example from qt which uses win32 libraries. When I compile I don't get any errors but when I run it is not able to open the application (.exe) file in Windows 7. But when I compile this example in WindowsXP it works fine. Can anyone let me know whether I need to change my .pro file in order to get it worked under Windows 7?
Here is my .pro file:
# -------------------------------------------------
# Project created by QtCreator 2010-04-16T11:45:43
# -------------------------------------------------
QT += network
QT += xml
QT += opengl
TARGET = Application
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \
Tools.cpp \
Objects.cpp
HEADERS += mainwindow.h \
Tools.h\
Objects.h
unix {
OBJECTS_DIR = .obj
MOC_DIR = .moc
}
# UNIX installation
isEmpty(PREFIX):PREFIX = /usr/local
unix {
headers.path = $$PREFIX/include/ZIP
headers.files = $$HEADERS
target.path = $$PREFIX/lib
INSTALLS += headers \
target
}
!mac:x11:LIBS += -ldns_sd
win32:LIBS += -ldnssd
LIBPATH = C:/Temp/mDNSResponder-107.6/mDNSWindows/DLL/Debug
INCLUDEPATH += c:/Temp/mDNSResponder-107.6/mDNSShared
You can use Dependency Walker to help you find out what Qt DLLs are needed and copy them to the same folder as the .exe.
Your problem is probably because Windows can't find the Qt libraries.
Try placing the required Qt libraries (for instance QtNetwork4.dll, etc...) in the same directory as your .exe and see if it works.

Resources