Unable to build standalone executable on Windows 7, Qt5.3.1
-
I've been trying to follow this: https://qt-project.org/wiki/Build_Standalone_Qt_Application_for_Windows
But recently discovered that because I used the online installer and did NOT build from source, that the directions weren't originally relevant. I now have 5.3.1 source downloaded and get the following error:
cd <path>\qt-everywhere-opensource-src-<version>
configure -static -release -platform win32-msvc- cd qtbase
- C:\Users\me\Desktop\qt-everywhere-opensource-src-5.3.1\qtbase\configure.bat -top-level -static -release -platform win32-msvc
Invalid option "win32-msvc" for -platform.
See the README file for a list of supported operating systems and compilers.
I've tried this in the following command prompts:
VS2013 x86 Native Tools Command Prompt
VS2013 x64 Native Tools Command Prompt
VS2013 x64 Cross Tools Command PromptQt 5.3.1
Windows 7, 64-bit
VS2013 compiler -
Hi and welcome to devnet,
You don't need to set platform. Just call configure -static -release from the top of the sources and then nmake (or jom) and you should be good to go.
-
Thanks, looking forward to doing more with Qt!
I was able to configure after reading the README, but the build failed. Note that I have the directory with all the source files on my Desktop.
Input:
@configure -prefix <current directory>\qtbase -opensource -nomake tests
nmake@Output:
@bq. bq. mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "......\bin\qlalr.exe". The operation failed.
NMAKE : fatal error V1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x02'@ -
Did you forget to confclean before reconfiguring ? You should consider doing an out of source build so if something goes wrong you can simply delete and restart.
-
[quote author="SGaist" date="1410216345"]Did you forget to confclean before reconfiguring ? You should consider doing an out of source build so if something goes wrong you can simply delete and restart.[/quote]
Yes, I did, trying that now. Can you provide the command line syntax for an 'out of source' build? I'm unclear on where I can specify source code path and then output path.
-
Looks like you didn't clean before re-configuring
-
Sorry, can you tell me how to clean? Something seems different in qt5.
It no longer seems to be:
@
make confclean
@run from that same directory.
-
pseudo bash:
@
C:\Users\me\Desktop
mkdir build_qt5
cd build_qt5
..\qt-everywhere-opensource-src-5.3.1\configure -release -static -nomake examples -nomake demos
@ -
I'm unable to build. Trying to be very explicit about my process. Things terminate with error U1077.
This post seems to suggest something along the lines of a bad example or needing to disable my antivirus?
http://stackoverflow.com/questions/10356198/error-when-compiling-qt-nmake-fatal-error-u1077@
Open VS2013 x64 Native Tools Command Prompt
Install perl, git, python, ruby
Perl
Git
Python
[Ruby](1.9.3 http://www.rubyinstaller.org/downloads/
Restart command prompt (and potentially machine) and ensure
these all now exist in your PATH variable
perl --version
git --version
python --version
ruby --versionMake separate directories for the source and build
cd \Users\blu083\Desktop
mkdir qt5source
mkdir qt5buildcd qt5source
git clone https://github.com/qtproject/qt5.git
// May have to move folders around
git checkout 5.3.1
perl init-repositoryClean any potential previous configuration
cd \Users\blu083\Desktop\qt5source
git submodule foreach --recursive "git clean -dfx"Create the config file
cd \Users\blu083\Desktop\qt5build
C:\Users\blu083\Desktop\qt5source\configure -release -opensource -static -nomake examplesCompile to the build directory
cd \Users\blu083\Desktop\qt5build
nmake
...
mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "......\bin\moc.exe". The operation failed.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\mt.exe"' : return code '0x1f'
@ -
Indeed, depending on which anti-virus you have on your computer, it may interfere with the creation of executable files.
-
You shouldn't need to run it as admin. Standard user should be enough to build and run.
-
Continuing with the directions here: https://qt-project.org/wiki/Build_Standalone_Qt_Application_for_Windows
It's unclear where I place the static build. At the highest level of my application? I also get stopped again by the following error in my process. Note that my PATH variable does NOT have a path to qmake, so I put in the full path to be more explicit about everything. I may end up needed an absolute path to mt.exe as well:
@
Open VS2013 x64 Native Tools Command Prompt
cd \Users\blu083\Desktop\MyQtProject\MyProjectApp
C:\Qt\5.3\msvc2013_64\bin\qmake MyApp.pro
nmake release
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in MainWindow.obj
cd release
mt.exe -manifest MyApp.exe.manifest -outputresource: MyApp.exe;1
@ -
Simple, you don't move a build
Did you cleanup your project before running qmake ?
-
Yes. But I still don't understand how are my built libraries found. Will these now conflict with files under @C:\Qt@ directory? Can I delete the qt5build directory from my desktop?
I am now getting problems where I cannot build a release via QtCreator:
@
MSVCRT.lib(MSVCR120.dll):-1: error: LNK2005: memmove already defined in LIBCMT.lib(memcpy.obj)
MSVCRT.lib(MSVCR120.dll):-1: error: LNK2005: free already defined in LIBCMT.lib(free.obj)
MSVCRT.lib(MSVCR120.dll):-1: error: LNK2005: malloc already defined in LIBCMT.lib(malloc.obj)
...
qtmain.lib(qtmain_win.obj):-1: error: LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Settings.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
@This problem only seems to exist on the PC on which I did a static build. A new PC, that I just downloaded Qt5.3 onto does NOT get these errors.
-
Did you by any chance modify Qt's sources to link against Visual Studio's static run time ?