I cannot build and run a simple Qt 5 application, - c++

I downloaded and installed Qt 5 on Windows 7.
I opened QtCreator 2.6.1 and created a new simple GUI application.
When I try to run it, it says:
“C:\Qt\Qt5.0.0\5.0.0\msvc2010\include\QtCore\qglobal.h:46: error:
C1083: Cannot open include file: ‘stddef.h’: No such file or
directory”
What is the problem and how do I solve it?
My compiler is: MSVC2010 32 bit

A google search yielded the following:
http://qt-project.org/forums/viewthread/10255
This thread notes that this error happens when you don't have the Microsoft Platform SDK installed and you are using Visual Studio. That would make sense considering that stddef.h is one of the standard headers (usually its included using <cstddef>, but looking at the source for qtcore/global.h it would seem that it is indeed included as <stddef.h>). So, try installing the platform SDK if it isn't already there.
If you already do have the sdk, perhaps it isn't configured properly. This answer says you need to follow the instructions given by microsoft here to do command line builds properly. I think Qt Creator probably executes the compiler from the command line, so that may help.
If that still doesn't work, try installing the MinGW compiler and using that. I have seen a few references saying that its easier to compile for Qt under windows using MinGW.

Related

Getting Juce to Work (Windows)

I downloaded Juce and VisualStudio2017 because through researches it seemed that Juce was a good way to create a GUI app dealing with midi files.
My problem is i can't even get to use the first examples of GUI !
I get this type of error, for multiple different files :
[...]\juce\modules\juce_core\native/juce_BasicNativeHeaders.h(135): fatal error C1083: Cannot open include file: 'wininet.h': No such file or directory (compiling source file ....\JuceLibraryCode\include_juce_audio_formats.cpp).
Can anyone help me ?
Looking for this wininet.h file into google doesn't appear to give me any help :/
It seems that Windows 10 SDK JUCE was targeting by default was broken - multiple files, like wininet.h mentioned by you are missing there.
There are a few ways you can fix it:
1) You can get the latest JUCE develop where it is fixed, in particular it was fixed here
2) You can instruct Projucer to use the fixed SDK version by changing Windows Target Platform to 10.0.16299.0 (make sure you have the latest version of Visual Studio 2017 and that you have downloaded the Windows 10 SDK version 10.0.16299.0) as shown...
...here
3) You can wait for the new official JUCE release where the fix will be included (i.e. available on master).
Sorry for late response, usually the quickest way to raise any issues is via visiting forum.juce.com

Build (compile) a basic standalone .exe application using Qt-creator on Windows 8

I have installed Qt-5.7 on windows 8 because I couldn't build my released .exe from Linux (my favorite) in order to be used on Windows OS even after searching a lot on internet (Where there have to be cross-compilation...). After the installation, I just want to make sure that I can build/run a first application (one of the examples provided by default by Qt-creator "filesystembrows") and I have follow the official guide in order to build Qt as shared libraries, but the issue is that when I type the first command line I get: 'nmake' is not recognized as an internal or external command' Also it still show the same message even though a update the variable environment of the system with C:\Qt\Qt5.7.0\5.7\mingw53_32\bin which one is the default path set-up when installing Qt on windows. Any help just to make a stand alone .exe for Windows (as shared libraries ) please
Why not build your project by using qtcreator ?
Did you test your build environnement by making a test application with qtcreator ?
P.S.: If you want, I can explain how to build application using Visual Studio as a compiler and QtCreator as an IDE.
nmake is a build tool provided with Visual Studio and with Windows SDK. You don't have it, apparently.
It seems you're using a mingw build of Qt; it comes with a bundled copy of mingw. There, the build tool is simply called make.

compiling Qt using nmake gives Command line error D8021 : invalid numeric argument ‘/FS’

I’m trying to deploy my Qt application to windows and I’m getting an error when I run nmake about /FS being an invalid numeric argument. It looks like it’s some kind of compile flag that’s not being recognized by the compiler. I have no idea on how to fix this and there doesn’t seem to be any information than what's already provided here http://qt-project.org/doc/qt-5/windows-deployment.html.
I posted my original question here Deploying a Qt 5.3 App on Windows
This person has the same problem Deploying a 32-bit Qt 5.3.0 app (Stand-Alone)
I’m on Qt 5.3 with Visual Studio 2013. As both question shows it seems to be running cl and nmake from VS 2010. I’m going to bet this is where the problem lies
Thanks for any help with this problem
Use cl.exe version 18.x to compile.
Had the same problem and it was me calling the wrong vcvars32.bat from qtenv2.bat, basically was using MSVC2010 with Qt for MSVC2013
As edwinc mentioned, compiler version should be 18.x
Qt 5.4.1, VS 2013. Fixed the issue by editing
C:\Qt\Qt5.4.1\5.4\msvc2013_64\mkspecs\win32-msvc2013\
removing faulty parameter from
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t
I ran into this same problem trying to compile the deprecated QtHttp and QtFtp modules for Qt5. You're right that the cause of the problem is a mismatch in MSVC compiler versions. Here are some of the things I found out for others encountering this:
qmake is going to pull in the mkspecs from qtbase. So if you built Qt with one compiler and try to compile an individual module using a VS command prompt from a different version, it won't care that you used the correct vsvars bat.
qmake can be passed the -spec flag to force it to use a given spec. E.g. qmake -spec win32-msvc2010.
Compiling Qt with one compiler version and your app with another will probably compile and link fine. Then it will crash or fail to start when you try and run it, at best. Worst case, you'll get weird subtle bugs at runtime.
If you had multiple Qt Kits installed, potentially due to running multiple Qt Creators, switching between kits could lead to such problems. Be meticulous in ensuring that you're using the right Qt Kit and, if it's an auto detected kit, then you're using the right Qt Creator.
With your project opened, review your kit:
Options > Build & Run
Select Kits tab
Ensure your kit is selected
In addition consider clicking on "Make Default" to set it as your default kit
That kit should now appear in italic bold
Do a QMake follow by a Rebuild
Did you try compiling with VS itself? Does it work?
Anyway, try checking C1.dll in your C:/windows/... folder (try searching the directories below it), is it an old one which being created like, 5 years ago? If so, you may want to replace it with a newer version such as those included inside your VS2013 folder.

Not able to compile C++ in NetBeans IDE - Gives error "CreateProcess error=193, %1 is not a valid Win32 application"

I'm trying to build a C++ application in NetBeans 7.3. I'm using the MinGW compiler & I set up the project as a new project from an existing makefile. When I try to compile, I'm getting the following error from NetBeans:
CreateProcess error=193, %1 is not a valid Win32 application
I've looked at the NetBean's forums and I've done the following:
Ensured that my Path variable included the MinGW bin.
Ensured that NetBeans C++ extensions were installed.
Can anyone give me some pointers on where to look next - I'm not terribly familiar with C++. I should mention that I'm running on a 64 bit machine, but I'm unsure if this is causing my problem.
Please check these points too:
Make shure there are no blanks in paths (eg. path to gcc or source files should not contain any blanks)
Do you call any shellscript or other linux / unix stuff within your makefile?
If you setup a new project (like a default c/c++ application) - does this work?
Since you're using an existing source / makefile: can you compile your project on another system?
Do you have mingw msys installed?
are there any other informations or is this the only error / message you get?
What version of MinGw are you using?

Qt Creator build error with under Windows

I want to port a multiple project MSVS solution to Qt Creator.
I created the .pro files for the projects and added them to Qt Creator.
When I build the projects I always get the same error shown below.
By the way I am using Qt 4.6.3 (VS 2008). What may cause this?
It's difficult to say what the problem is frmo the jom.exe output.
It might be that the command it's trying to execute on the console is too long (MS reference).
A similar problem was reported here, although is not clear if it was solved.
I suggest you upgrade to a more recent version of Qt and try again (sorry).
You could change your make step from jom to nmake (found in the projects window) to see if it gives you a more detailed error.
It also seems that you do not have any source code files in your project, just your library's header files.