Qt/Windows & VC++ 2008 Express - Part1
In this part I'll show how to build Qt4 with MS Visual C++ 2008 (9.0) Express ( yes, it out there
) :
Requirement:
- MS Visual C++ 2008 (9.0) Express
- Qt/Windows Open Source Edition (.Zip version )
Steps:
- decompress the file to folder of your choose let refer it as QtSource e.g:
- C:\QtSource\
Update: From "Visual Studio 2008 Command Prompt":
- now execute "configure.exe" , to prepare the source
- C:\QtSource> configure
- C:\QtSource> configure
- now run 'nmake" command , to compile the source ( it will take long time , 1 hour - 4 hours) :
- C:\QtSource> nmake
-
At thing point, you have almost everything ready
, now have a fun playing with the the demos ( QtSource\bin\qtdemo.exe ):- C:\QtSource> cd bin
- C:\QtSource> qtdemo
Environment Configuration:
Assumptions:
- Qt bin folder --> C:\QtSrouce\bin
- Qt lib folder --> C:\QtSrouce\lib
- Qt Headers folder --> C:\QtSource\include
System configure:
- Open My Computer -> Properties -> Advanced -> Environment Variables
-
Add new variable QTDIR as follows :
-
QTDIR=C:\QtSource
-
- Edit PATH variable by appending the following path:
- ;%QTDIR%\bin
VC++ configure: (Tool -> Options , in VC++ Directories)
- Show directories for: Include files:
$(QTDIR)\include
- Show directories for: Library files:
$(QTDIR)\lib
That's all for now ![]()

Comments
jaime on on 10.03.2008 at 10:45 PM
hi man! thank u for this post but i still have a problem with:
3. Edit PATH variable by appending the following path:
;%QTDIR%\bin
i dont get it! what i do in here! then the examples r working good but the compiler dont let me execute couse dont detect the libs and the includes. please a little help i apreciate it too much
da-crystal on on 10.04.2008 at 4:40 AM
The perpose of step 3 of "System configure", to make QT(dll's) visible to any program that need it.
I'm assuming you have successfully done the other steps because it important.
- Now, in the "Environment Variables" window there are two panels one for user variable and other for system.
- From "System Variables", scroll down, to locate "Path" then double click it or select it then click on "Edit"
- From "Edit System Variable" window, add ";%QTDIR%\bin" at the end of Variable value. make sure you have done step 2 in "System configure"
To double check you configuration,in Command Prompt, execute the following command:
"where QtCore4.dll"
You should get the full path of "QtCore4.dll" as an answer.
Note: sometime(never have) you need to restart your PC to get that in effect.
Also, this may help: www.youtube.com/.../watch
suresh on on 10.20.2008 at 2:32 PM
A small convenience :
Make a Qt property sheet and add to Qt related projects.
Create a file Qt.vsprops and paste following
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="Qt"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""$(QTDIR)\include";"$(QTDIR)\include\QtGui""
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="QtCore4.lib QtGui4.lib"
AdditionalLibraryDirectories=""$(QTDIR)\lib""
/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="$(QTDIR)\include"
/>
<UserMacro
Name="QTDIR"
Value="C:\Qt\4.4.3"
PerformEnvironmentSet="true"
/>
</VisualStudioPropertySheet>
For projects using Qt add above property sheet to project.
View->Property Manager then add this file.
jaime on on 10.21.2008 at 3:02 AM
hi i did what u said, but the error that apears when execute an instance says:
for example for tutorial1 t1.exe
not can find the component
not find QtOpenGLd4.dll. reinstall may help to solve the problem
but i know the installation is fine. couse the qtdemo works, it sopouse that when i build an example in vc++ then i can play a new instance...
or i have to start the instance from console??
da-crystal on on 10.21.2008 at 12:40 PM
@suresh: thanks very much, it is a cool and a smart way :D
BTW, I'm using CMake in all my C++ projects which help in IDE configuration.
@jaime: I think that happen because you are compiling and linking you code in debug mode where your Qt have been compiled as release. In your case, you might re-compile Qt to generate debug files or re-configure the Debug mode to link to Qt's release one.
I hope that will solve it. Waiting your feedback ;)
Seth on on 1.26.2009 at 12:55 PM
Hi, I've followed your tutorial and set everything up as you've stated. In the cmd prompt i can execute "where QtCore4.dll" and get the correct path. When i try and compile a simple test program though,
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.show();
return app.exec();
}
this is what it spits out:
1>------ Build started: Project: Test, Configuration: Debug Win32 ------
1>Compiling...
1>Test.cpp
1>c:\users\seth\documents\visual studio 2008\projects\test\test\test.cpp(1) : fatal error C1083: Cannot open include file: 'QApplication': No such file or directory
1>Build log was saved at "file://c:\Users\Seth\Documents\Visual Studio 2008\Projects\Test\Test\Debug\BuildLog.htm"
1>Test - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
not really sure what I'm doing wrong.
da-crystal on on 1.26.2009 at 3:54 PM
Hi Seth,
try to change:
#include <QApplication>
#include <QPushButton>
To:
#include <QtGui/QApplication>
#include <QtGui/QPushButton>
Or you can add Qt-modules-include-path to VC++ Environment. To do so,just repeats the steps for configuring "$(QTDIR)\include" to add the following:
* $(QTDIR)\include\QtCore
* $(QTDIR)\include\QtGui
Hopping this will solve yours.
Regards,
Seth on on 1.26.2009 at 11:57 PM
Thanks for the quick response, my one error turned into 10...
it looks like they are all linker errors.
error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QApplication::~QApplication(void)" (__imp_??1QApplication@@UAE@XZ) referenced in function _main
they all look something like this.
Thanks again for the help.
da-crystal on on 1.27.2009 at 8:29 AM
Thats normal :D, you just need to specify Qt's linking libraries(depends on what Qt modules you are using).
For your earlier code, you need to link to:
* QtCore4.lib
* QtGui4.lib
To do so, from project properties:
Configuration Properties --> Linker --> Input --> Additional Dependencies --> add "QtCore4.lib QtGui4.lib" to what you have in there
Anyway, CMake very handy when dealing with Qt configuration specially when using non-default-Qt-modules(other than QtCore & QtGui).
Regards,
da-crystal on on 1.27.2009 at 8:33 AM
Btw, have a look to the 3rd comment (by suresh) it a very convenience way to configure you Qt projects.
Seth on on 1.27.2009 at 10:18 AM
Thanks a million! I finally got it to work.
Seth on on 1.27.2009 at 10:27 AM
Now, if I could only figure out why on some eclipse with QT installed I get No Binaries problems and in other places with QT installed with eclipse everything runs the way it should, I would be perfect.
radu on on 2.09.2009 at 12:32 AM
Thanks man! The last one with the linker solved my problems. Thanks a lot!
Jorge on on 4.30.2009 at 10:38 PM
Hi i'm Jorge
my application works fine but when i build it, vsc++ 09
show this warning
applicationname.exe not found or not built by the last incremental link; performing full link
qtmaind.lib(qtmain_win.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'C:\QT\lib\qtmaind.lib' or at 'c:\Visual Studio 2008\Projects\applicationname\Debug\vc90.pdb'; linking object as if no debug info
i can't run this .exe in others computers, i need help, thx.
Bisnis Online Internet on on 5.06.2009 at 12:36 PM
Very useful information, thank
ricky on on 5.10.2009 at 3:55 AM
thanks for informing
free ebook on on 5.18.2009 at 8:26 PM
Excellent post thanks for sharing
Armoric on on 5.22.2009 at 3:11 AM
Hi, and thanks for the very useful infomation.
I am having the same kind of link errors than Seth (on 8th comment) and though I followed all of the advices given there I keep getting the same 3 links errors :
1>qtmain.lib(qtmain_win.obj) : error LNK2019: symbole externe non résolu "__declspec(dllimport) public: void __thiscall std::locale::facet::_Register(void)" (__imp_?_Register@facet@locale@std@@QAEXXZ)
référencé dans la fonction "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@std@@@std@@YAABV?$ctype@D@0@ABVlocale@0@@Z)
1>qtmain.lib(qtmain_win.obj) : error LNK2019: symbole externe non résolu "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<char>::_Getcat(class std::locale::facet const * *)" (__imp_?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z)
référencé dans la fonction "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@std@@@std@@YAABV?$ctype@D@0@ABVlocale@0@@Z)
1>qtmain.lib(qtmain_win.obj) : error LNK2019: symbole externe non résolu "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<unsigned short>::_Getcat(class std::locale::facet const * *)" (__imp_?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@@Z)
référencé dans la fonction "class std::ctype<unsigned short> const & __cdecl std::use_facet<class std::ctype<unsigned short> >(class std::locale const &)" (??$use_facet@V?$ctype@G@std@@@std@@YAABV?$ctype@G@0@ABVlocale@0@@Z)
I saw on a forum a guy with the same problem as me, and exactly the same code (ie we just created a new project and tried to compile it without adding anything), he said he resolved his problem the following :
"got Desktop -> Systray first, compile it without Config += console in the project file and it gives exactly 3 linking errors. When i enable console, its linking ok."
Well, I'm quite noob at VC/Qt (and C+ as well but this time I didn't code anything) but if I'm not mistaken, project files are .vcproj files, looking a little bit like xml syntax ?
I'm confused by the advice, not knowing where exactly I should put that "config += console" thing to try it out. Could someone give precise indications ?
Sulumits Retsambew on on 6.02.2009 at 10:05 PM
thanks for this nice info sir!
robert on on 6.15.2009 at 2:19 AM
great post, thanks a lot..
Rusli Zainal Sang Visioner on on 6.15.2009 at 1:53 PM
Very nice discussion, i get a new things from here. thanks a lot.
Stop Dreaming Start Action on on 6.20.2009 at 10:31 AM
Nice post! very interesting topic. keep on posting.
Jorge ferrera on on 6.22.2009 at 6:13 PM
Hi,
I have to put another lib to qt works with me, I put qtmain.lib in "Additional Dependencies" too
In other words, put
* QtCore4.lib
* QtGui4.lib and qtmain.lib, boys ;)
hugs.
moving company on on 6.26.2009 at 3:49 PM
how far can we go together?
denver movers on on 6.26.2009 at 3:49 PM
how lovely it is?
San Francisco Movers on on 6.26.2009 at 3:50 PM
can it be better now?
donno?
cant believe it
listerine toenail fungus on on 7.10.2009 at 3:45 AM
Wow..nice tips on how to build Qt4 Thanks for sharing
Blogger Tutorial on on 7.15.2009 at 1:47 PM
thanks for share this, but I think need more experience for me to do this :(
online phd degree on on 7.17.2009 at 12:34 PM
I think need more experience for me to do this :(
online Master Degree on on 7.17.2009 at 12:35 PM
Wow..nice tips on how to build Qt4 Thanks for sharing
distance learning university on on 7.17.2009 at 12:37 PM
how to build Qt4 Thanks for sharing
college degree on on 7.17.2009 at 12:37 PM
how far can we go together?
online Bachelor Degree on on 7.17.2009 at 12:37 PM
lib to qt works with me, I put qtmain.lib in "Additional Dependencies" too
جيل on on 7.31.2009 at 6:18 AM
thank you
http://www.jeel5.com/vb http://www.jeel5.com/pr http://www.jeel5.com
فحص البيج رانك on on 7.31.2009 at 6:18 AM
thank you
http://www.jeel5.com/vb http://www.jeel5.com/pr http://www.jeel5.com
فحص البيج رانك on on 7.31.2009 at 6:18 AM
thank you
http://www.jeel5.com/vb http://www.jeel5.com/pr http://www.jeel5.com
stop dreaming start action on on 8.03.2009 at 1:19 PM
nice tutorial for guide
Contractor Florida on on 8.14.2009 at 12:17 PM
Seems Little bit difficult.
rusli zainal sang visioner on on 8.14.2009 at 12:43 PM
very usefull for us...thank you blog.cicurug.com/.../stop-dreaming-s
acne removal on on 8.23.2009 at 4:31 PM
very usefull information. thanks for sharing
Tiffany Rings on on 8.25.2009 at 12:05 PM
i like
stop dreaming start action on on 9.04.2009 at 4:04 AM
great post, thank you for sharing
توبيكات on on 9.08.2009 at 10:07 AM
great post, thank you for sharing
cara membuat blog on on 9.15.2009 at 6:24 AM
I will wait your article Qt/Windows & VC++ 2008 Express Part 2,Thanks
mengembalikan jati diri bangsa on on 9.17.2009 at 10:22 PM
I will wait your article Qt/Windows & VC++ 2008 Express Part 2,Thanks
kenali dan kunjungi objek wisata di pandeglang on on 9.17.2009 at 10:23 PM
I will wait your article Qt/Windows & VC++ 2008 Express Part 2,Thanks
mengembalikan jati diribangsa on on 9.17.2009 at 10:24 PM
I will wait your article Qt/Windows & VC++ 2008 Express Part 2,Thanks
mengembalikan jati diribangsa on on 9.17.2009 at 10:25 PM
I will wait your article Qt/Windows & VC++ 2008 Express Part 2,Thanks
mengembalikan jati diribangsa on on 9.17.2009 at 10:26 PM
I will wait your article Qt/Windows & VC++ 2008 Express Part 2,Thanks
mengembalikan jati diri bangsa on on 9.17.2009 at 10:27 PM
I will wait your article Qt/Windows & VC++ 2008 Express Part 2,Thanks
mengembalikan jati diri bangsa on on 9.17.2009 at 10:27 PM
waiting part 2
mengembalikan jati diri bangsa on on 9.17.2009 at 10:28 PM
waiting parts 2
free games on on 9.22.2009 at 10:35 PM
Thanks!
interface networks on on 10.12.2009 at 9:39 AM
thx for vc++ tutorial looking for more tutorials.
Tiffany Rings on on 10.24.2009 at 6:43 AM
i like
Plot Movie on on 10.30.2009 at 1:34 AM
hi i did what or he said, but the error that should Wait for the reading and when an instance should be executed he says:
for example, for Tutorial1 t1.exe
it cannot find the component
It did not find QtOpenGLd4.dll. to reinstall can help to solve the problem
but I know that the installation is well. couse the qtdemo you work, sopouse that when I am going to construct an example in VC + + then I can play a new instance...
or do I have to initiate the instance of the console??
links of london on on 11.11.2009 at 2:31 PM
Thanks a million! I finally got it to work.
tiffany jewellery on on 11.13.2009 at 10:19 AM
Thanks, that useful information
auto insurance on on 11.24.2009 at 10:30 PM
thanks for share this, but I think need more experience for me to do this :(
auto insurance on on 11.24.2009 at 10:30 PM
thanks for share this, but I think need more experience for me to do this :(
Gucci Eyeglasses on on 11.25.2009 at 10:13 PM
I am happy to find many useful information in the post, writing sequence is awesome, I always look for quality content, thanks for sharing.
Edmonton Web Design on on 12.01.2009 at 2:29 AM
Thanks for sharing another great post. I am happy to find it.
work at home jobs on on 12.05.2009 at 10:37 AM
Really very nice tutorial. Thank you for sharing.
work at home jobs on on 12.05.2009 at 10:37 AM
Really very nice tutorial. Thank you for sharing.
omerce on on 12.09.2009 at 2:07 PM
Tool
Name="VCLinkerTool"
AdditionalDependencies="QtCore4.lib QtGui4.lib"
AdditionalLibraryDirectories=""$(QTDIR)\lib""
/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="$(QTDIR)\include"
/>
<UserMacro
Name="QTDIR"
Value="C:\Qt\4.4.3"
PerformEnvironmentSet="true"
/>
</VisualStudioPropertySheet>
For projects using Qt add above property sheet to project.
View->Property Manager then add this file.
tiffany and co on on 12.15.2009 at 4:49 AM
Exquisite design, superior material, exquisite craft.Close to her heart, the most perfect expression of your love
links london on on 12.26.2009 at 1:47 PM
exquisite craft.Close to her heart, the most perfect expression of your love
Astaga.com lifestyle on the net on on 12.29.2009 at 3:34 PM
It was an amazing article! A writer like you should be given credit for your dedication to work as your provide good quality articles with the good purpose. I like to read such articles for they tackle different issues in our society as well as different practicalities and knowledge that a certain person should or must know. I will keep reading your next post that will be an interesting article again as usual.
Festival Museum Nusantara on on 12.29.2009 at 3:35 PM
This is very nice content and informative blog
Indonesia Java International Destination on on 12.29.2009 at 3:37 PM
Nice information, valuable and excellent design
mbah gendeng on on 12.30.2009 at 4:04 PM
nice post
how to get a six pack on on 1.03.2010 at 6:09 PM
It was an amazing article! A writer like you should be given credit for your dedication to work as your provide good quality articles with the good purpose. I like to read such articles for they tackle different issues in our society as well as different practicalities and knowledge that a certain person should or must know
how to get a six pack fast on on 1.03.2010 at 6:10 PM
Nice information, valuable and excellent design
how to get a six pack quickly on on 1.03.2010 at 6:10 PM
This is very nice content and informative blog
Home Lighting on on 1.04.2010 at 12:23 PM
Thanks for sharing this.
Wedding Dresses on on 1.05.2010 at 10:43 AM
i commend you on your great content and excellent topic choices.
Mbt Lami on on 1.08.2010 at 8:11 AM
Mbt shoes are physiological footwear. They can improve posture and gait. Welcome to order Mbt Chapa, Mbt walking shoes.
http://www.discountmbt.com/
web design ny on on 1.18.2010 at 11:58 AM
These kind of post are always inspiring and I prefer to read quality content so I happy to find many good point here in the post, writing is simply great, thank you for the post.
web design ny on on 1.18.2010 at 11:58 AM
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic.
Russian Food on on 1.18.2010 at 11:58 AM
I am happy to find this post very useful for me, as it contains lot of information.
Movers Staten Island on on 1.19.2010 at 12:44 PM
Hi webmaster, commenters and everybody else ! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!b Keep 'em coming... you all do such a great job at such Concepts... can't tell you how much I, for one appreciate all you do.
tour bus new York on on 1.19.2010 at 12:45 PM
We sincerely enjoyed your article. It looks like you have placed a lot of effort into your blog and I need more of these on the net these days. I do not really have a large amount to say in reply, I only wanted to sign up to say great work.
Ares on on 1.19.2010 at 7:21 PM
something new about VC++
tiffany jewellery on on 1.24.2010 at 3:00 PM
Great updates to read
HJHJ on on 1.27.2010 at 12:48 PM
www.macquicktimeconverter.com QuickTime Converter Mac</a>
www.machdvideoconverter.com/.../quick-time-conv QuickTime Converter for Mac</a>
www.3giphoneringtonemaker.com 3G iPhone Ringtone Maker</a>,
http://www.swftomp4mac.com/ SWF to MP4 Converter Mac</a>
proximity switches on on 2.01.2010 at 10:02 AM
Great updates to read
True Religion Jeans on on 2.05.2010 at 5:29 AM
2010 Latest Designer True Religion Jeans
Seven jeans with 59% Discount
Seven for mankind Promotion Now on jeans-classic. http://www.jeans-classic.com
UGG Boots sale on on 2.06.2010 at 9:00 AM
nice post!
Astaga.com lifestyle on the net on on 2.10.2010 at 6:47 AM
Nice tutorial with related pictures
Como gano dinero on on 2.13.2010 at 10:54 AM
Thanks for the tutorial!
asdfasdf on on 2.21.2010 at 8:43 AM
With this MP4 to MP3 Converter for Mac software, you can extract your favorite songs or dialogues from a movie very easily and quickly. www.mp4tomp3converterformac.com http://www.dvdiphoneconverter.com/ www.powerpointtoavi.com
gucci shoes on on 2.22.2010 at 5:29 AM
Gucci Handbags www.gucci-shoes-bags.com/.../8-gucci-handbag Gucci wallets www.gucci-shoes-bags.com/.../9-gucci-wallets
farmville tips on on 2.23.2010 at 1:50 PM
I can here the new knowledge.
Thanks for the great reference post.
GHD on on 2.25.2010 at 7:49 AM
[url=http://www.ghdhairirons.com/]ghd[/url] is being sold at low prices. you will get [url=http://www.ghdhairirons.com/]cheap ghd[/url], try to keep a piece of [url=http://www.ghdhairirons.com/ghd-black-hair-straighteners-limited-edition-p-48.html]ghd black[/url] .
Edinburgh Accommodation on on 2.26.2010 at 4:55 AM
I think, it’s a helpful topic. I like this topic. I want know some helpful things from this side. It fresh my mind and experience. So lots of thanks for sharing this information with me.
dentists on on 2.26.2010 at 6:01 AM
There are many private <a href="http://www.cosmeticdentistryguide.co.uk/dentists/staffordshire-cosmetic-dentist.html"> dentists </a> in <a href="http://www.cosmeticdentistryguide.co.uk/dentists/staffordshire-cosmetic-dentist.html">Staffordshire </a> to choose from that offer cosmetic dentistry treatments such as laser teeth whitening, the Inman Aligner, smile makeovers with porcelain veneers por lumineers veneers for a natural or hollywood smile, invisalign braces to straighten crooked teeth and a variety of cosmetic crowns, dentures and white composite fillings to replace those old amalgam, metal filings. Browse our list of <a href="http://www.cosmeticdentistryguide.co.uk/dentists/staffordshire-cosmetic-dentist.html">Staffordshire </a> cosmetic <a href="http://www.cosmeticdentistryguide.co.uk/dentists/staffordshire-cosmetic-dentist.html"> dentists </a>.
Business and Finance Tips on on 3.03.2010 at 4:31 AM
Finally I think this is great post and awesome. You must create another incredible post then. I had searched and I found this groovy post. Thx.
cellex-c on on 3.03.2010 at 9:04 PM
Lots of thanks for this post. I think it is a very good post. It helps us many away. So many many thanks for this article.
auto insurance on on 3.04.2010 at 8:34 AM
Thank for the information. Keep blogging.
Divaderme on on 3.05.2010 at 12:58 AM
I like it very much. Its so interesting. Its a very useful article.
cellex-c on on 3.05.2010 at 4:11 AM
This site is so helpful. I want to know some other information about this post. So please give some other information about this side.
coach handbag outlet on on 3.05.2010 at 8:39 AM
The variety of coach handbags are so many that it almost becomes difficult to choose the right one.
coach handbags on on 3.05.2010 at 8:39 AM
You are sure to find one for every occasion.
discount christain louboutin on on 3.05.2010 at 8:40 AM
one of the most famous brand known in fashion.
MBT trainers shoes on on 3.05.2010 at 8:41 AM
Well that is certainly unique and different.
rolex replica on on 3.05.2010 at 9:23 AM
good idea!
Divaderme on on 3.06.2010 at 9:12 AM
I think it is the famous article in all. Every person please visit this site and read this article. It will be provide lot of helpful and interesting things for us.
Cara Cepat Terindex Google on on 3.07.2010 at 12:41 PM
Nice article
interest rates calculator on on 3.12.2010 at 5:24 AM
wow, great, but now, find how it changes?
coach outlet on on 3.12.2010 at 10:41 AM
coach always attract people's attention, since people are fond of coach bags especially coach handbags .
http://bagworlds.com/
chase auto loan on on 3.13.2010 at 2:40 AM
Thanks for the information! I've been meaning to start this process myself so this is a big help.