qmake

Undefined reference to boost::system::generic_category() with Qt

孤人 提交于 2019-12-24 02:54:45
问题 Currently trying to use boost threads in a Qt application (I know Qt has its own thread functions but here I'm using boost) but I get linker errors no matter what I do. There's a ton of questions around the net about this problem but so far I have not been able to solve it. I do know my boost stuff works right because I can use all the headers in a code::blocks application but in that I just linked to every single file in the boost/stage/libs folder. The simplest example where things go wrong

QMAKE adding extra quotations in lib path of make file

≡放荡痞女 提交于 2019-12-24 00:37:16
问题 After many obscure errors (at least to me), I discovered while trying to set up a QtCreator project file for use with CUDA that there were some extra quotation marks being put in the LIBS definition of the Makefile.Debug and Makefile.Release files. LIBS = /LIBPATH:"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\lib\x64" ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\lib\x64"\cuda.lib" ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\lib\x64"\cudart.lib" /LIBPATH:C

How to generate 64-bit Visual Studio projects from qmake

拟墨画扇 提交于 2019-12-23 16:50:04
问题 I am using Qt Creator to create some shared library and application projects so that I can easily build them on Windows and Linux. On Windows, some of us prefer using Visual Studio so I want to generate Visual Studio solution and project files from the Qt .pro files using qmake -tp vc -r file.pro . Everything works exactly as expected except that the generated Visual Studio solution and projects only contain 32-bit build configurations and I need 64-bit configurations. It's not a big deal to

Add CFLAGS to QMake project without hard-coding them in the .pro file?

心已入冬 提交于 2019-12-23 16:33:43
问题 I'm using a distributed compiler, and I need to add -m64 to CFLAGS , CXXFLAGS and LDFLAGS . Usually, my definitions in .bashrc are fine, but qmake ignores them for some reason. The standard way of doing this seems to be to edit the .pro file, but I obviously don't want to hard-code the architecture. So, I can edit the .pro file, but I can't hard-code anything in it. I tried setting CXXFLAGS like this: QMAKE_CXXFLAGS += $(CFLAGS) But it says: Makefile:17: * Recursive variable `CXXFLAGS'

qmake touch function on windows

你离开我真会死。 提交于 2019-12-23 12:47:14
问题 The qmake manual documents a touch function to update the time stamp of a file, see: touch(filename, reference_filename). It is recommended here to update the timestamp on a file, e.g.: version.commands = touch $$version.target Note: the qmake manual documents two parameters, e.g.: version.commands = touch $$version.target $$version.depends However, I can't get the touch function to work on Windows using either call. I suspect that qmake is simply calling the linux touch command, since it

Is it possible to add a dependency to your Makefile in qmake?

自作多情 提交于 2019-12-23 12:05:43
问题 Currently, I have a file which contains some version tagging information which is used by the .pro file and parsed by qmake, but the problem is that when that file changes qmake is not re-run. Is it possible to add something to the .pro file so that qmake will treat this file as a dependency for the Makefile? 回答1: Sometheing like this should work: depend_on_file.target = depend_on_file depend_on_file.depends = path_to_your_txt_file depend_on_file.CONFIG += recursive QMAKE_EXTRA_TARGETS +=

Qt moc.exe not generating *.moc file

独自空忆成欢 提交于 2019-12-23 09:47:40
问题 I'm trying to build the qtestlib/tutorial1 example , but the testqstring.moc file isn't being generated when I run nmake (I'm running Qt 4.5.2 on Windows XP SP3). I copied testqstring.cpp from the tutorial directory to my build directory ( C:\sandboxes\testqstring ) and from the Qt command prompt ran vsvars32.bat file from my MS Visual Studio 8 installation to add the VS environment variables. According to the tutorial, I should run: > qmake -project "CONFIG += qtestlib" > qmake > nmake When

how-to add “warnings as error” rule to Qt .pro file?

两盒软妹~` 提交于 2019-12-23 07:07:51
问题 When I usually work on a C++ project, one of the first things I do is setting up the "treat warning as errors" on my compiler. When using Qt , qmake generates the Makefile for you and doesn't include this option on the compilation commands. I'm pretty sure there is a way to add such an option (and others) into the generated Makefile but I couldn't figure it out. How would I do that ? I'm using the open-source version of Qt with g++ as the compiler. 回答1: You can use QMAKE_CXXFLAGS in pro file

How to generate a Visual Studio project file when I build my qmake project?

痴心易碎 提交于 2019-12-23 03:21:44
问题 I like to do most development using Qt Creator, and the builds are driven with qmake and jom. I occasionally want to use Visual Studio for debugging. I'd like to know what magic to put into the .pro file to automatically generate a Visual Studio project file during the project build, every time the .pro file changes. 回答1: You can have your qmake project set up so that it automatically generates a Visual Studio project file on every build. The below assumes that the base name of the .pro file

How to generate a Visual Studio project file when I build my qmake project?

大兔子大兔子 提交于 2019-12-23 03:21:19
问题 I like to do most development using Qt Creator, and the builds are driven with qmake and jom. I occasionally want to use Visual Studio for debugging. I'd like to know what magic to put into the .pro file to automatically generate a Visual Studio project file during the project build, every time the .pro file changes. 回答1: You can have your qmake project set up so that it automatically generates a Visual Studio project file on every build. The below assumes that the base name of the .pro file