How to compile Qt App using "Debug" in Visual Studio 2005 [Solved]
-
Hello,
According to this FAQ:
I need to install the VS Add-In with the “Debugger Extension” checked, but still I am unable to compile using Debug.
The error message I get, when using Debug, is the following:
@-
Linking...
-
qtmaind.lib(qtmain_win.obj) : fatal error LNK1103: debugging information corrupt; recompile module
@
So I did the obligated search to find more info. about this and there is a FAQ also whith this error but it wasn't very helpful.
Also when I try to compile with Release I get no error and Application runs fine.
I am very new to this stuff, so any hints and comments will be very helpful.
Thanks.
-
-
Hi,
Which version of Qt are you using now? Does this version compiled by MSVC2005 or not?
-
I installed this:
qt-win-opensource-4.8.2-vs2008.exe
qt-vs-addin-1.1.11-opensource.exeMy small application compiled successfully using the Release option in VS2005 but when I try to use Debug it throws me the error mentioned. Any hints?
thanks for your reply.
-
welcome to devnet
You cannot use the sources compiled for vs2008 with vs2005. The binaries are not compatible. AFAIK it should not work in release mode either.
Either you are getting a newer version vc or you need to compile Qt with vc 2005. There is a "wiki":http://qt-project.org/wiki/Building_Qt_Desktop_for_Windows_with_MSVC available. It refers to the most recent visual studio, but should work also for the older versions. Make sure to use for settings the ones for vs2005.
-
The common problem is with nmake. Make sure to open the command prompt through vs. Otherwise nmake and possibly other environment settings will not be found. Be prepared that configure takes some time and also the compilation itself. One needs a bit of patience.
-
So I downloaded Qt Source Code and run "configuration", using Visual Studio 2005 Command prompt.
And as a recommendation for new guys like me, dont label your folders with "spaces".
E.g I labeled my directories...
C:\Qt\source code\qt <--- didn't work
C:\Qt\sourcecode\qt <--- worksAfter the configuration stuff I ran "nmake" in the same command prompt window
And it surely takes a while (as in It still hasn't finished after almost 2 hours)
Well I'm going to wait & see what more results I can get about this topic.
-
[quote author="Qnoobish" date="1345066780"]
And as a recommendation for new guys like me, dont label your folders with "spaces".
[/quote]That is an interesting remark. Seem to be valid for some of the folders but not in general.
Would be good if you report differences, if any, to the procedure in the wiki.
-
So aparently right now it looks like nmake finished doing it's stuff.
I would expect a "Everything OK" message at the end so I am not sure if nmake succeded.Nevertheless in my VS project I added the generated library and try to buidl with debug. And it build & linked successfully but when I try to run it throws me an error window that says.
"The application failed to initialize properly (0xc0150002). Click on OK to terminante the application."
Hopefully someone has any comment regarding this :O
Thanks
-
Did nmake stop with an error message?
Typically you will see a couple (actually a bucket full) of warnings. However the lines would indicate an error if something happened. During my last recompilation on one machine I could simply restart the nmake and eventually it finished without error.Probably you should get all other versions of Qt out of your way to make sure that you are using the version you expect. Especially you can get rid of the vs2008 binaries as you downloaded. As long as you are not changing to newer version of vs there is no use.
-
nmake stopped without errors.
And after your mention I uninstalled Qt libraries binaries for VS2008.
And in the VS Qt Addin I added the correct version I am using.
First I added the path under Qt options and then chose the correct version under Qt project settings. This solved my last error when I tried to run my application :)
So now I can build and run using Debug and Release in Visual Studio 2005.So I think everything is in order, I believe.
Thanks to everyone that shared their ideas and comments they were all very helpful.
-
[quote author="koahnig" date="1345102133"][quote author="Qnoobish" date="1345066780"] And as a recommendation for new guys like me, dont label your folders with "spaces". [/quote] That is an interesting remark. Seem to be valid for some of the folders but not in general. Would be good if you report differences, if any, to the procedure in the wiki. [/quote]
About this I try to give it a look :), thanks.