qmake

PRECOMPILED HEADERS not working in debug build with Qt Creator / qmake / MinGw

淺唱寂寞╮ 提交于 2019-12-01 04:20:45
问题 In Qt Creator, I have a pro file using PRECOMPILED HEADERS. The build works just perfect when I build in Release mode. But building in Debug mode gives errors, generating object files failing. Example: 17:12:40: Running steps for project Euclide... 17:12:40: Configuration unchanged, skipping qmake step. 17:12:40: Starting: "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" C:\Qt\5.2.0\mingw48_32\bin\qmake.exe -spec win32-g++ CONFIG+=debug -o Makefile ..\euclide\Euclide.pro C:/Qt/Tools/mingw48_32

Qt how to open a file in current dir ? or what's wrong with this?

感情迁移 提交于 2019-12-01 04:08:30
问题 I'm trying to open an xml file in the current location of the executable QString path = QDir::currentPath(); path.append("/acc.xml"); QFile file(path); if(!file.open(QIODevice::ReadOnly)) { insertItem("IO ERR"); } When I run it from Qt creator, everything works. currentPath() returns the path to the executable's folder When I go to project-build-desktop/ folder and try to run it manually currentPath() returns /home/user/Documents EDIT also tried with same results: Qt::current().path(); Qt:

Preprocessor output on Qt Creator

旧巷老猫 提交于 2019-12-01 03:37:25
I am compiling C code in Qt Creator and I need to look at the preprocessor output. I added the -E flag to the make, but I don't see the *.i files: mingw32-make.exe -e -w in \qt\qt-build-desktop Please help. -E is a gcc option, not a make option, so passing it to make won't do anything. Also, using -E works fine for a single file, but will break your build as no proper .o file is generated (it contains the preprocessed source). What works fine though is adding the following to the .pro file: QMAKE_CXXFLAGS += -save-temps Now if you build your project, the preprocessed source of source file foo

Build a JNI DLL using MINGW

吃可爱长大的小学妹 提交于 2019-12-01 03:20:16
问题 I am trying to create a DLL that will call Qt (currently I can't use Jambi for the functionality I need). I have a simple Java method: public final native int createChild(int handle); I created C project in Visual Studio Express 2010 and was able to build the DLL. Then I created a project in Qt creator and moved my sources there. I tried to configure the build to a best of my knowledge but all I get is: java.lang.UnsatisfiedLinkError: tools.proofofconcept.control.EmbedderComposite.createChild

How to get a Makefile from qmake

主宰稳场 提交于 2019-12-01 03:13:26
Given an x.pro file, how can I produce a makefile? Running qmake x.pro produces an x.pbproj directory without a Makefile. Thanks Edit: Adding info. about the pro file and platform. I am running this on Mac OS X (10.6). The same pro file used to produce a Makefile under OpenSUSE. Here is a snippet of the pro file: TEMPLATE = lib TARGET = x DEPENDPATH += INCLUDEPATH += CONFIG += qt debug QT = core network # Input LIBS += -lcryptopp HEADERS += x.hpp ..... # rest of the header files Kamil Klimek I gues that you're using Mac OS X qmake -spec macx-g++ x.pro on Mac OS X to generate Makefile qmake x

Qt 5.5 with qmake: Linker cannot resolve OpenGL function calls

与世无争的帅哥 提交于 2019-11-30 20:41:51
When using Qt 5.5, qmake and MSVC 13 to compile a basic, boilerplate Qt application with some fundamental OpenGL function calls, I get the following linker errors: glwidget.obj:-1: error: LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "public: virtual void __thiscall GLWidget::initializeGL(void)" (?initializeGL@GLWidget@@UAEXXZ) glwidget.obj:-1: error: LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "public: virtual void __thiscall GLWidget::initializeGL(void)" (?initializeGL@GLWidget@@UAEXXZ) debug\OpenGLApp.exe:-1: error: LNK1120

How to specify compiler flag to a single source file with qmake?

倖福魔咒の 提交于 2019-11-30 20:22:28
While other source files use the default flags? Some of my source files need some extra C++ preprocessor defines. I use Qt 5. I only found QMAKE_CXXFLAGS is for global use in qmake projects. lpapp This is what used to be done in theory for GUI painting in the Qt source itself: SOURCES_NOOPTIMIZE = somefile.cpp nooptimize.name = nooptimize nooptimize.input = SOURCES_NOOPTIMIZE nooptimize.dependency_type = TYPE_C nooptimize.variable_out = OBJECTS nooptimize.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_IN_BASE}$${first(QMAKE_EXT_OBJ)} nooptimize.commands = $${QMAKE_CXX} $(CXXFLAGS) -O0 $(INCPATH

Qt - Using asterisk (*) in .pro-File with directories

℡╲_俬逩灬. 提交于 2019-11-30 20:16:30
I have a .pro file which looks like: SOURCES += myfolder/source1.cpp \ myfolder/source2.cpp HEADERS += myfolder/header1.h\ myfolder/header2.h FORMS += myfolder/form1.ui\ myfolder/form2.ui And everything works great. However, if I try to use an asterisk to include all the files, i.e.: SOURCES += myfolder/*.cpp HEADERS += myfolder/*.h FORMS += myfolder/*.ui qmake throws a file-not-found-error: WARNING: Failure to find: myfolder\*.cpp [...] :-1: error: No rule to make target `myfolder/*.cpp', needed by `release/source1.o'. Stop. In both cases, Qt-Creator can find the files. Is there a way to use

Developing QT applications in Xcode?

泪湿孤枕 提交于 2019-11-30 19:07:26
My IDE of choice for the Mac (at least for C++ and Objective-C development) is Xcode. I have a 64-bit Intel Mac with OS X Lion installed, and Xcode version 4.2 downloaded from the Mac App Store. My problem is that Qt is apparently not compatible with Xcode 4 (it crashes when launching projects generated by qmake), so I'm basically asking how I can integrate Qt with Xcode. I don't have to be able to run and debug the project from Xcode, just build it. So I thought it might be a solution to use qmake as an external build system within Xcode, the problem is that I have no idea how to set up qmake

Create dir & Copy files with qmake

自古美人都是妖i 提交于 2019-11-30 18:29:04
问题 I am trying to copy target binary file in multiple folders. In first step I must create those multiple folders. I have followed this example without success. The only thing that worked was system(mkdir $$OUT_PWD/newFolder) , but I'm trying to use QMAKE_EXTRA_TARGETS for $(MKDIR) followed by $(COPY) from this example. Using Qt 4.8.6 with qmake 2.01a. This is how I run qmake: qmake Server.pro -r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug Update: This is my current implementation,