Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Friday, June 4, 2010

Complete guide for Installing and Running your first GUI Application in Qt c++ in Windows 7 (for Newbies)

Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code.

Recently I installed Qt 4.5.2 on my Windows 7 PC and had some minor installation and post-installation issues which I shall discuss here.

Step 1.

Download Qt SDK: Follow this link to download

Qt is available for download as a free 30-day commercial evaluation, or under the LGPL open source license. Choose whichever license you want. However, every time you build projects using commercial edition Qt will display a license popup.

Annoying

Step 2.

Install Qt to whichever directory you want. Like i installed it at C:\Qt\2009.03\ . This path will be needed later.

Step 3.

Write a simple Qt-c++ program like the one given below just so that we can use it to test if the installation is properly done and the environment variables are properly set. Just write this piece of code in notepad and save it as HelloQt.cpp in a directory HelloQt. Remember the path since it will be used later.

#include <QtGui/QApplication>

#include<qlabel.h>

int main(int argc, char *argv[])

{

QApplication app(argc, argv);

QLabel *label = new QLabel(" Hello Qt!",0);

label->show();

return app.exec();

}

Step 4.

Setting Environment variables.

  • From the desktop, right-click My Computer and click Properties.
  • In the System Properties window, click on the Advanced tab.
  • In the Advanced section, click the Environment Variables button.
  • Finally, in the Environment Variables window (as shown below), highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown below.
  • Environment

    Append the following variable value to Path : C:\Qt\2009.03\bin; C:\Qt\2009.03\qt\bin

    Note that the above Path depends on the directory where Qt was installed previously, like mine was C:\Qt\2009.03\.

    Step 5.

    Open Qt command prompt which is installed along with Qt and has a shortcut in Start-menu.

    qt command prompt

    Step 6.

    Change directory to where you have saved HelloQt.cpp in your system.

    cd C:\QtProj\HelloQt

    Step 7.

    Type the following commands …

    qmake –project

    qmake HelloQt.pro

    nmake

    commands

    The first command will generate a .pro file (HelloQt.pro)

    The next command will generate a MakeFile for your project

    Finally nmake shall create a .exe file of your project and the .exe shall be saved inside either the debug or the release folder by the name HelloQt.exe

    directory

    Problem with using nmake command

    If windows shows some error like “nmake is not a recognised internal or external command”, this means nmake is not installed on your system. To install, you need to downloading, extract, and place two files into your C:\WINDOWS\system32 or C:\WINDOWS\ folder.

    Follow the steps below to install nmake on your PC

    1. Download nmake : Use this link or Google nmake15.exe if this links is broken -http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
    2. Extract nmake: Run the Nmake15.exe file which will extract two files to the directory where it is located. These files will be nmake.exe and NMAKE.ERR.
    3. Now move those two extracted files to C:\WINDOWS\system32.

    This should install nmake on your system.

    If you follow the above steps correctly, you are ready to use Qt to create GUI applications on your Windows PC.

    Saturday, June 7, 2008

    Computer programming in Hindi ???

    Open source softwares are developing globally and gaining wide popularity at a brisk rate. Indian developers are playing a key role on the development of the open source software industry. The Indian developers have come up with a variety of open source software solutions which is helping millions of users in India and globally.

    One such really smart desi open source software is Hindawi programming system.
    Hindawi is a multilingual programming language tool. This means that using this software, we can program in languages other than English.


    Hindawi is also the winner of the FOSS India awards for 2008 which clearly shows how successful it has been. [the FOSS india awards is a well recognied initiative to appreciate free and open source softwares developed by indians and the award is supported by the LINUX FOR YOU magazine ]

    The users can write programs in various Indian languages including Hindi, Guajarati, Bengali, assamese etc

    The great thing is the wide varieties of programming languages it supports. It allows the user to program in the equivalents of C, C++ , lex , yacc , BASIC , LOGO and even assembly and many more computer languages.

    The equivalent languages are called Hindi C or Hindi assembly or bangle C correspondingly.

    Moreover these equivalent languages are syntax-compatible with their traditional English counterparts and can therefore utilize the existing libraries such as glibc etc in a manner similar to the way C++ is syntax compatible to C and hence can use most of the C libraries.

    After winning the FOSS '08' award, key developers of Hindawi , Abhishek Choudhary and Sweta (Karwa) Choudhary shared, "Hindawi Programming System has shattered the technological myth that full-fledged programming systems cannot be feasibly developed in non-English languages. This is evident from the flurry of activity seen towards reproducing our results globally, and especially the interest of commercial entities in doing so... Let us think of our brothers and sisters who have not been privileged enough to go to English-medium schools. Even they have a right to benefit from the ICT revolution at all levels of technology, from primary school education to robotics and super-computing in their mother tongue, without the need to master English."

    download Hindawi here : http://hindawi.in/en_US/download.php


    Powered By Blogger
    Custom Search