Qt command error when nmake the odbc files - c++

I'm new for C++ and Qt.
Recently, I was learning Qt with MS SQl, but I met a problem when compiling the odbc files.
Firstly I run qmake and it goes well. But when I use nmake, the following errors happened:
module machine type 'x64' conflicts with target machine type 'x86'

I encountered similar problem just today.
Same as you,
I tried almost all comand tools include the one in qt, vs2015 x86,x64
command prompt, and cross tools as well. But none of them works.
I solved the problem by the following:
Deleted the whole project and its folder completely.
Created the project anew.
Made sure %PATH% variable, aside from irrelevant paths, contained only path to proper Qt build. In my case %PATH% contained 'C:\Qt\5.5\msvc2013_64\bin'. By proper i mean, of course, a Qt build that was built using the same compiler I was trying to compile with.
Then I ran VS2013 x64 Native Tools Command Prompt.
Switched to the project folder.
Then i did qmake and then nmake and it was all OK.
I think the problem was that, as drescherjm suggested,
If you tried one time with the wrong command prompt then tried again on the same build folder you build folder would have been broken by the bad try.
and therefore,
You will have to clean build between tries.

Thanks to drescherjm and Herman Nurlygayanov, the problem is finally solved.
Here is some experience I get from this problem:
The version of Qt creator whether 32-bit or 64-bit should be made sure before all these stuff by checking the About Qt creator. It is important to choose the right version of command prompt before compiling.
Besides, If a 32-bit command prompt is used, then vcvars32.bat should be executed. As for 64-bit version, vcvarsall.bat should be executed. They are located in %dir of you vs%/vc and %dir of you vs/vc/bin respectively.
If any error happened during one compiling, another qmake must be executed in next attemption.

Related

Run failed in Netbeans 8.2, c++ "No such file or directory" (Beginner)

I'm setting up the Netbeans IDE, and i downloaded Cygwin for the compiler, make and debugger (Windows 8.1). The problem is that when i try to debug or run, this error happens.
C:\\cygwin64\\bin\\bash: exec /cygdrive/C/Users/MyName/Documents/NetBeansProjects/Pi_1/dist/Serial/Cygwin-Windows/pi_1.exe: No such file or directory
RUN FAILED (exit value 127, total time: 90ms)
I don't know if i'm missing something to install or if i used wrong versions of g++, make, etc...
I had experienced a similar problem on other IDEs (haven't used Netbeans). It turned that the anti-virus was quarantining the executable generated after compilation. I just "whitelisted" (prevent anti-virus from scanning in future) the directory where i saved my programs, and that solved the problem.
I had such error. In my case the folder name in the project path was the reason. Try to change location of your project to something simple, like "c:\NetBeansProjects\prj1".
Happened to me as well. The reason, as already mentioned, was that the build folder contained characters as () and spaces.
C / Windows 10
Just to add, I had the same problem when saving my projects in a different folder than the predefined one. Example: C:\Users\username\Desktop\C_Programs\new12. This was fixed using the predefined project folder: C:\Users\username\Documents\ NetBeansProjects\new12.(Windows 10)

Cannot run Qt C++ release build. 'The procedure entry point could not be located'

I am trying to deploy my Qt application and have run into a fatal error. The program works fine in the Qt editor, I can build and run it. After building my project in release mode and using windeployqt.exe to get the correct .dll's in the folder, I am treated to this error message. I get one for 5 different Qt .dll's. I found a way to remove this error by using the .dll's from Qt tools instead of the ones found in the compiler's bin directory. But, I am left with a remaining error like this. Unlike the previous errors', there is no dll being cited, only my program's directory.
I've tried this with 2 compilers by now. That which is provided by Qt, and my own installation. Both you can tell, have failed.
I had a similar problem few years ago when I was just learning QT. What I tried which did worked is that to move the .exe generated file to the location from where you copy paste the dlls and it worked like charm. You are getting the wrong dlls copied (perhaps). Try searching for correct ones on google!!

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.

Configuring Eclipse for MinGW

I am using Eclipse Juno with MinGW (latest version) on my Win7-Laptop.
My example code is successfully built within the IDE, but I can neither run nor debug it!
When I choose Run as=>Local C/C++-Application, I get
Launch failed. Binary not found.
However, there IS an exe-file as a result of the build process!
When I call cmd.exe, navigate to the source directory and call this built exe (a.out.exe), it works without problems!
I guess this is due to wrong/missing configuration of eclipse, but I couldn't find useful info on that so far.
This thread mentions environment variables. I added MinGW and Msys to my PATH variable (that's why I can compile) but I can't run my software in eclipse!
So, what can be done to enable debugging?
I have made a little tutorial.
how to set all for Eclipse have a look it's here https://stackoverflow.com/a/12169583/1322642
Hope it can help you a little bit.

Building Qt cross compile from windows

[edit] Sorry, I out thought myself. I was using a .bat file to set environment variables that wasn't set up properly. When I went to a straight VS2005 command prompt, the configure ran fine. Sorry for the noise.[/edit]
I'm trying to compile qt-everywhere-opensource for embedded. I'm using MSVC2005. However, I guess I am confused on the process. I am getting compiler errors during the configure step. I thought the configure step was just trying to generate the needed makefiles, so I'm not sure what it is trying to compile.
I expected to modify the mkspec, but I'm not sure if during configure I should point to windows headers or sdk headers. I know during the build phase I should point to sdk headers, but I'm not getting that far.
I can change the errors by modifying INCPATH, there's also a QMAKE_INCDIR that seems to have an effect. It occurred to me that since I pulled the source, maybe configure needs to build the compiler tools, in which case I should point to MSVC headers. I also tried downloading the SDK and adding the path to it's bin folder to my path ahead of the -everywhere- source, but that didn't fix the problem and I don't want to jack up my system too much testing things.
Hope someone out there can help!
When you install Qt from source under Win32, you must:
Extend the PATH variable to include $(QTDIR)\bin, where $(QTDIR) is the directory where you installed Qt.
Open a Visual Studio command prompt in $(QTDIR); a plain old Windows command prompt won't do (unless you run vcvars.bat to load Visual Studio's environment variables; but opening a Visual Studio command prompt directly is better).
At this point, configure should run properly, after which you can run nmake.
I suggest that you clear your previous installation attempts from your system before you try these steps.