Problem compiling/deploying with Qt Creator 2.6.2, possible bug?
-
Hi!
I am using Qt 4.8.4 (msvc2008, static) to code one of my projects and to distribute the executable to my "schoolmates" (end user). I can compile my program using Qt Creator 2.6.2 and it run properly in my PC but when it is distributed to my end-user, they get an error:
bq. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
However when I compile my program using an OLDER Qt Creator 2.6.0, the distributed executable works on all of my end-user machines, "plus my executable is reduced by 0.5Mb in size".
Is this a possible bug in Qt Creator 2.6.2? How can I solve this?
Thanks in advance -
Qt Creator plays no part in the binary code generation or linking, it is just a shell around your compiler of choice. You "solve this" by determining what is different about the compiler and libraries that are being used and why it should result in linking against a different Microsoft VC++ runtime... or you could just deploy the required MSVC runtime.
The Dependency Walker may help identify what libraries are required.
-
It could be, however, that build environment is set a bit differently in 2.6.2. Check if there are changes there, too.
-
[quote author="sierdzio" date="1360571398"]It could be, however, that build environment is set a bit differently in 2.6.2. Check if there are changes there, too.[/quote]
I am thinking the same way. But how can I find that? It is possible that 2.6.2 and 2.6.0 have different sets arguments passed to the compiler. I have not much knowledge of Qt Creator's internal. Qt Creator 2.6.2 is AFAIK is better (and faster, I think) but for my current project, I will be using Qt Creator 2.6.0 temporarily until the problem is solved.
[quote author="ChrisW67" date="1360571058"]or you could just deploy the required MSVC runtime.[/quote]
That is also possible but another extra MB into my package is NOT a practical way in deploying it. If I go that way, how can I install it using "Inno Setup"? Since I am using it in creating the installer.
-
You can check build steps, build environment and run environment for every project from "Projects" pane on the laft-hand side of Qt Creator.
-
[quote author="sierdzio" date="1360586173"]You can check build steps, build environment and run environment for every project from "Projects" pane on the laft-hand side of Qt Creator.[/quote]
Found out the 2 versions of Qt Creator uses the SAME arguments passed to qmake. Found no differences.
-
It is not the arguments to qmake, rather which qmake and the arguments to your C++ compiler/linker generated by qmake that are of importance.
Are the two Qt Creator versions running the same qmake from the same instance of Qt?
Is the resulting Makefile invoking the same C++ compiler with the same arguments?
... including the same library search paths in the same order?
... including the same external libraries in the same order?Something is different or you would not be getting a different result.
-
Basically Creator does not build anything, it just runs commands you would normally run on the command line. Which commands those are is shown in the Projects mode: It runs qmake with some arguments (check the qmake step) and then make/jom/nmake. Check the make step for which arguments are used there.
What might have changed in subtle ways is the environment used to run the commands in. Check the Environment settings.
-
[quote author="ChrisW67" date="1360641594"]Are the two Qt Creator versions running the same qmake from the same instance of Qt? [/quote]
Yes. They are using the same qmake.
[quote author="ChrisW67" date="1360641594"]
Is the resulting Makefile invoking the same C++ compiler with the same arguments?
... including the same library search paths in the same order?
... including the same external libraries in the same order?[/quote]I will check on it. Thanks! But I think they will be of same result since they are using the same qmake.
[quote author="Tobias Hunger" date="1360654959"]Basically Creator does not build anything, it just runs commands you would normally run on the command line. Which commands those are is shown in the Projects mode: It runs qmake with some arguments (check the qmake step) and then make/jom/nmake. Check the make step for which arguments are used there.
What might have changed in subtle ways is the environment used to run the commands in. Check the Environment settings.[/quote]
Are there any "internal" arguments coming from Qt Creator NOT revealed to the user?
-
Code_ReaQtor: Nope. Everything creator uses is displayed in Projects mode. Creator is supposed to play nice with the command line, so using secret arguments would be stupid.
-
[quote author="Tobias Hunger" date="1360672603"]Code_ReaQtor: Nope. Everything creator uses is displayed in Projects mode. Creator is supposed to play nice with the command line, so using secret arguments would be stupid.[/quote]
Thanks! I can't still find any answer as to why my deployed application have such an error. All I just did was to shift from 2.6.0 to 2.6.2 and everything are similar, like both version points to the same qmake. Found some solutions from MSDN about updating the VC++ Runtime. I can't do that though since I don't control the end-user's computer.
-
Sorry, I am no windows expert...
Are you really using the same compiler? There were some fixes to MSVC support (even though that was in master/2.7 IIRC), maybe that resulted in you switching compilers without noticing.
Are you really using the same Qt version? Easier to pin down:-)
Are you really using the same environment in both versions of creator? This is the most likely candidate for your trouble.
-
[quote author="Tobias Hunger" date="1360687470"]
Are you really using the same compiler?
Are you really using the same Qt version?
Are you really using the same environment in both versions of creator? This is the most likely candidate for your trouble.[/quote]Yes, yes, and yes... :)
I am only using a specific compiler. VS2008
I only have a single Qt version built in static mode in my machine. Qt 4.8.4 msvc2008 - static
My 2.6.0 and 2.6.2 version have the same environment. -
What kind of output do you get when running qmake/make on the command line?
-
[quote author="Tobias Hunger" date="1360741849"]What kind of output do you get when running qmake/make on the command line?[/quote]
actually, nothing different from other "qmake" (other Qt Version) I have
@C:\QtSDK\Desktop\Qt\4.8.4\msvc2008-static\bin>qmake
Usage: qmake [mode] [options] [files]QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing projectMode:
-project Put qmake into project file generation mode
In this mode qmake interprets files as files to
be built,
defaults to *.c; *.ui; *.y; *.l; *.ts; *.xlf; *.qrc; *.h; *.hpp
; *.hh; *.hxx; *.cpp; *.cc; *.cxx
Note: The created .pro file probably will
need to be edited. For example add the QT variable to
specify what modules are required.
-makefile Put qmake into makefile generation mode (default)
In this mode qmake interprets files as project files to
be processed, if skipped qmake will try to find a project
file in your current working directoryWarnings Options:
-Wnone Turn off all warnings; specific ones may be re-enabled by
later -W options
-Wall Turn on all warnings
-Wparser Turn on parser warnings
-Wlogic Turn on logic warnings (on by default)
-Wdeprecated Turn on deprecation warnings (on by default)Options:
- You can place any variable assignment in options and it will be *
- processed as if it was in [files]. These assignments will be parsed *
- before [files]. *
-o file Write output to file
-d Increase debug level
-t templ Overrides TEMPLATE as templ
-tp prefix Overrides TEMPLATE so that prefix is prefixed into the value
-help This help
-v Version information
-after All variable assignments after this will be
parsed after [files]
-norecursive Don't do a recursive search
-recursive Do a recursive search
-set <prop> <value> Set persistent property
-unset <prop> Unset persistent property
-query <prop> Query persistent property. Show all if <prop> is empty.
-cache file Use file as cache [makefile mode only]
-spec spec Use spec as QMAKESPEC [makefile mode only]
-nocache Don't use a cache file [makefile mode only]
-nodepend Don't generate dependencies [makefile mode only]
-nomoc Don't generate moc targets [makefile mode only]
-nopwd Don't look for files in pwd [project mode only]@