Qt supports compiling all including qml without MSVC. So how to install qt creator and qt studio without them, how to create qt package that will not rely on MSVC at all?
You could build QtCreator with mingw and distribute it in your classroom : take a look at the Readme https://github.com/qt-creator/qt-creator
If you cannot install MSVC redistributable run times, you can either build your own package using MinGW (see other answers, but note that you only need to rebuild Qt Creator and Qt 3D Studio, not Qt intself).
Or you can install the official packages that do depends on MSVC runtimes (for QtCreator and Qt Studio) and instead of installing the MSVC Redistributable Package, you can copy paste the required DLLs to the installation folder (e.g C:\Qt\Tools\QtCreator\bin for Qt Creator).
For Qt Creator it seems that you will need:
MSVCP140.DLL
VCRUNTIME140.DLL
You can check the missing DLLs using Dependency Walker or similar tools.
Note that if copying the DLLs around is not recommended by Microsoft, but it does work. And it is less cumbersome that rebuilding Qt Creator.
It's also possible to directly install redistributable Visual C++ DLLs
in the application local folder, which is the folder that contains
your executable application file. For servicing reasons, we do not
recommend that you use this installation location.
https://learn.microsoft.com/en-us/cpp/ide/redistributing-visual-cpp-files
Related
Are there any advantages for building a Gtk3 app for Windows OS with the MSVC Visual C++ Compiler over msys2 mingw (ucrt64)?
Functionality-wise? Look-wise? Debug-wise?, Deployment-wise?
I'm new in a project that builds Gtk2 apps for Windows with Visual C++. No one really remembers if there was a special reason for using Visual C++.
I was asked to create a build process for the Gtk3 version.
I came up with using Mingw (ucrt64) with msys2 which is one of the ways described on Gtk Windows page.
Packaging and Build:
I installed the necessary packages with msys2 and I'm able to build the app both with mingw and with Visual C++. With mingw I can use pkgconfig with cmake. With Visual C++ It's not so straight forward - I just give it hard-coded paths.
Debug:
When building with mingw I was able to also debug with gdb (also by using VS code). I haven't tried to debug the Visual C++ build yet.
Deployment:
After the Mingw build I created some shell script to copy dlls, icons, etc.. to a release dir and I can package this this and deliver it. Is there a better way with Visual C++?
I have installed Qt using an offline installer qt-opensource-windows-x86-msvc2015_64-5.8.0. I have visual studio community edition 2017 installed with c++ build tools. because it's compiler was incompatible with the qt version, then I installed visual c++ build tools 2015 from http://landinghub.visualstudio.com/visual-cpp-build-tools . When I try to compile a project it gives an error :-1: error: LNK1158: cannot run 'rc.exe'. Heres how my qt kit looks like,
Can someone figure out whats the mistake and how to fix it.
Thanks.
I've fixed this both on my own machine and on several co-workers machines.
It tends to happen when you have both Visual Studio 2015 and VS 2017 installed. Or more precisely, multiple versions of the Windows SDK installed. When that happens, the vcvars32.bat script (located in your Visual Studio install dir) does not correctly add the location of the resource compiler (rc.exe) to your PATH. Thus, QT Creator runs vcvars32.bat (as specified in Qt Creator under Option->Build&Run->Compilers, but the tools directory for the Windows SDK Kit isn't properly added to the PATH environment.
The simple fix is to add the appropriate version of RC.exe to your path.
Do this from the command line:
cd "c:\program files(x86)"
dir /s rc.exe
You'll get several versions (x86 and x64) and for several versions of the SDK. Add the PATH for where rc.exe lives for the version that corresponds to the SDK and build flavor to your vcvars32.bat startup script.
For example:
PATH="C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86";%PATH%
Restart Qt Creator and that should fix it.
Another fix that worked for me is to uninstall all versions of Visual Studio (and all those side installs of SQL, Windows SDKs, dev tools, etc...). Reboot. Then cleanly install VS 2017 again. Then cleanly uninstall and re-install all of Qt again. That seemed to work for me. A wonderful way to spend an afternoon.
If you update to Qt 5.9 it supports MSVC 2017. However, if you want to get it working with 5.8, I believe you might be missing the Windows SDK. You can download the SDK from Microsoft for Windows 7, 8 or 10, just get whichever version is appropriate for you.
With some googling I found a couple of other somewhat related solutions here, & here, and I've summed them up below:
If you've already got the SDK or installed it and it still doesn't work, it appears that copying rc.exe and rcdll.dll from the WindowsSDK folder to your MSVS installs \VC\bin folder may fix the problem. You might also try copying those same two files to Qt's \Qt*version number**compiler version*\bin.
I am relatively new to the Qt. At the moment I'm trying to configure Qt library for my machine before installing add-in for VisualStudio'10. I tried to download Qt library only (withouth a Qt creator IDE), and found "qt-everywhere-opensource-src-5.3.2.zip" and extracted it to my external drive: "F:\Programs\Qt\5.3.2". Then I run command "configure" on VisualStudio command prompt.
F:\Programs\VStudio'10\VC>cd F:\Programs\Qt\5.3.2
F:\Programs\Qt\5.3.2>configure
After a while it gave me following error:
Running configuration tests...
NMAKE : fatal error U1077: 'F:\Programs\VStudio'10\VC\BIN\link.EXE' : return cod
e '0x463'
Stop.
Could not find output file: No such file or directory
WARNING: The DirectX SDK could not be detected:
There is no Direct X SDK installed or the environment variable "DXSDK_DIR" is
not set.
Disabling the ANGLE backend.
WARNING: Using OpenGL ES 2.0 without ANGLE.
Specify -opengl desktop to use Open GL.
The build will most likely fail.
On the installation instruction that was found on Qt webpage, it was said to set environmental variables: "Add this 2 paths to the Environment Variables: “C:\Qt\2009.01\bin” and
“C:\Qt\2009.01\qt\bin”." But I was unable to find any "bin" directory in my qt-everywhere folder. Instead I set up following variable to my path: "F:\Programs\Qt\5.3.2\Qtbase\bin". Still no help.
How can I resolve these issues? Any ideas and help are highly appreciated.
What you've done is more like attempting to prepare building Qt itself from the source code (but that is not exactly how to do that, anyway). You don't need that at least now but when you start customize Qt framework, say, for static build. That is when configure tool comes handy. And you will need to read on that.
You need just to download its installer from: http://qt-project.org/downloads
I assume you don't have prebuilt Qt and Qt Creator in your system but that is prerequisite for what you want to do. Take either Community version or start download immediately. After you've installed certain Qt version for your platform including Qt Creator (which is native Qt IDE) you will also be able to install and use Visual Studio AddIn. And then take Visual Studio AddIn for Qt 5 from: http://download.qt-project.org/official_releases/vsaddin/qt-vs-addin-1.2.3-opensource.exe and install it. Read the instruction on how to use it. There will be some new menu for importing Qt project, though.
BTW, Qt Creator itself is not bad at all and maybe preferable for most of Qt development tasks except some debugging. I maintain entire project in Qt Creator and write the code there and only occasionally go to Visual Studio with AddIn installed to import Qt project there for some better debug experience.
you can try run "configure -opengl"
or , you can download Microsoft DirectX SDK and install it ,then try again.
http://www.microsoft.com/en-us/download/details.aspx?id=6812
I am open to either a Visual Studio answer or a MinGW answer. I just finished building LLVM 3.2 using CMake and Visual Studio 2010. Everything went smoothly, but I have no llvm-config. Do I need it? Every example I see on the intertubes makes use of that tool. If I don't need it, how do I configure my project to make use of LLVM?
To be clear, I am not trying to use LLVM tools/compilers (like clang and whatnot). I am trying to write C++ code that uses the LLVM libraries to produce LLVM IR and even compile that stuff. I setup my include and lib folders. I ran llvm-config in Linux and saw a long list of macros and libraries.
I have a wonderful folder full of goodies. It just has no llvm-config in there: C:\Program Files (x86)\LLVM\
llvm-config does not exist in windows prebuilt binaries. You need to compile from the source code to get it.
Grab CMAKE > 3.5 , install it and make sure you add it to PATH.
Download Visual Studio 2019
Donwload the source code (9.0.1 is the latest as I'm writing this)
Extract the source code
Cd into the root of the llvm source-code
In cmd, type cmake . this will generate Visual Studio 2019 sln.
open sln file(LLVM.sln), change the build type to Rlease, build the whole project
navigate to your Rlease\bin, and there you have your llvm-config.exe
If you have built the LLVM in debug version all the executables (including llvm-config) have been placed in your build directory (containing Visual Studio project and solution files) in bin/Debug/ subdirectory. In case of release build replace Debug with Release.
If you are interested in using LLVM on Windows more than building it, check out Windows snapshot builds.
I want to make QtCreator able to compile with mingw and msvc but i don't know how.
I found some information over the internet but didn't work for me.
I tried by installing
QtSDK + qtvs2008 + qt visual studio addin [FAIL]
QtCreator standalone + mingw + qtvs2008 + qt visual studio addin [FAIL]
QtCreator compiled with visual studio + mingw + qtvs2008 [FAIL]
I don't know what else to try so i will need some help here.
Is this thing possible?
I have vs2008 installed. When I download the latest Qt version and create project in Qt Creator it automatically adds targets for mingw and msvc. In other words, when you install Qt SDK select "custom" install and check what components you are installing. Addons for vs2008 is included in the package.
Start with the Qt SDK. That gives you Qt Creator, the MinGW compiler, and a Qt version compiled with MinGW, and is suitable for developement with MinGW out-of-the-box. Then add a stand-alone version of Qt binaries build with MSVC, or get the sources and compile it yourself (configure.exe and nmake from a MSVC command prompt). In Creator you go to Tools->Options->Qt4 Version, and 'Add' the MSVC version by pointing the entry to the bin\qmake.exe in the MSVC version. Afterwards you should be able to switch between the MinGW and MSVC version in the Project tab. You don't need the Visual Studio AddIn.
While installing, choose custom type of installation. Selecte libraries for needed compilers in QtSDK->Development Tools->Desktop Qt->Qt-.
4/1/2016
I think maybe you need this qt online_installers. With this way, maybe you can make qt-mingw and qt-msvc work together.
Here are the configure screenshot: