Hi again,first i must say that i am familiar with c++ but only console programming. I am beginner so can you please be more gentle. I want to move on programming with buttons,windows,check boxs,input box and so on,i have heard of API and GUI what is the diference ? They are used for ? And when i try to compile some code Qt 4 code with DevC++ it gives me a lot of error,can you tell me why i get that error,do i need new compiler or there are missing compiler libraries ? Thanks for your help and lost time with my problem :)

Recommended Answers

All 18 Replies

Hi again,first i must say that i am familiar with c++ but only console programming. I am beginner so can you please be more gentle. I want to move on programming with buttons,windows,check boxs,input box and so on,i have heard of API and GUI what is the diference ? They are used for ? And when i try to compile some code Qt 4 code with DevC++ it gives me a lot of error,can you tell me why i get that error,do i need new compiler or there are missing compiler libraries ? Thanks for your help and lost time with my problem :)

Basically an API is like a library, or a bunch of resources that one progammer/programmers made for others to implement.

A GUI is any program that interacts with the user with graphics

The reason Qt isn't compiling is probably because you're doing it wrong, or you don't have qt on your computer. What OS are you using? It should come with most KDE linux distros

I suggest learning Gtk+, it's much easier for beginners
http://zetcode.com/tutorials/gtktutorial/

Hope I helped :)

Hi again,first i must say that i am familiar with c++ but only console programming. I am beginner so can you please be more gentle. I want to move on programming with buttons,windows,check boxs,input box and so on,i have heard of API and GUI what is the diference ? They are used for ? And when i try to compile some code Qt 4 code with DevC++ it gives me a lot of error,can you tell me why i get that error,do i need new compiler or there are missing compiler libraries ? Thanks for your help and lost time with my problem :)

I honestly prefer basic console programming, you don't have to worry about registering windows classes and checking 18billion errors. If your going to use windows GUI then get a Microsoft compiler (VC++ 2008 Express Edition for example). You can't compile the code in DevC++ because Dev does not have all the library's that compilers like Microsoft compilers use. That is also why .exe's compiled with Dev are usable on any system while compiled with Microsoft's compiler the computer needs to have the .net framework.

In my point of view, Windows programming is pointless for most things, but if you move to it: Program a console app then import the class to Dev, it will make things simpler.

Thanks i will try that,so now here is what i think about application programming : You dont need to know for example a lot of c++(except functions,classes),the main thing about making applications is the GUI,i sow examples of Qt4 and all the stuffs were made in Qt4,there was nothing like "cout" and etc,or i am wrong about the meaning for making applications ?

I would suggest allegro (probably version 4.2). I've been using it for about a year, and it makes it super easy to program gui. Plus it is platform independent so you can take code written on a windows pc and compile it on a mac or linux. It even supports systems like beOS.

Go to alleg.sourceforge.net for the download and http://wiki.allegro.cc/ for the how to.

Hope this helps!

Oh! Learning wxwidgets and C++ are easier, at least for me it have been. You use C++ codes. Only there are ready classes that you inherit to make your GUI and all the widgets. So with GUI, you must be immersed in C++ OOP concepts especially Inheritance.

That Book plus tutorials like one in www.zetcode.com should boost you up. But In case you choose wxWidgets as your GUI toolkit.
Here are GUI toolkit (Heavy weight ones) that closely compete:
1. wxWidgets
2. QT
3. GTKmm

So once you choose one, you have a go! :)

Thanks i will try that,so now here is what i think about application programming : You dont need to know for example a lot of c++(except functions,classes)

that's not necessarily true, you should probably know pointers and references if you want to product code that is worthwhile

,the main thing about making applications is the GUI,i sow examples of Qt4 and all the stuffs were made in Qt4,there was nothing like "cout" and etc,or i am wrong about the meaning for making applications ?

Many times toolkits take things like consle output into there own hands. For example in Gtk+ there is not printf() ; instead you use g_print() . This stuff depends on the toolkit/API

I also noticed you've gotten referals to like 5 different toolkits/APIs; I just wanted to say this:

I suggest learning Gtk+ as your first GUI toolkit, here's an article about it, and why it's good etc:
http://www.freesoftwaremagazine.com/community_posts/why_gtk_may_just_be_best_gui_toolkit_ever

Once you have some experience in GUIs move onto Win32 if you are planning to do anything in Windows. Win32 is the best way to make GUIs in Windows

Hope I helped :)

on,i have heard of API and GUI what is the diference ?

Most of the time, the functions to create a GUI are part of an API, but the difference lies in the fact that an API doesn't necessarily have to feature a GUI, we could for example talk about a network API, which enables you to let your program communicate over a network.

(Possible) Definitions:

An application programming interface (API) is a set of routines, data structures, object classes and/or protocols provided by libraries and/or operating system services in order to support the building of applications.

A graphical user interface (GUI, ) is a type of user interface which allows people to interact with electronic devices such as computers.
(Most of the time you can also make use of a mouse pointer within a GUI, but this isn't necessarily always the case, you can also have GUI's which only interact via a keyboard for example).
You actually already know what a GUI is: you probably use it all the time when you're working on your computer, you can control it with mouse and keyboard...

Oh, yes: If I had to choose between GTK+ and wxWidgets, I would choose wxWidgets.
Though this is just my opinion, the only way to find out what the best for you is, is by trying them out both, and stay with the one which fits best your needs and which you do like the most.

:)

commented: Nice post +36

I think that the wxWidgets will fits my needs the best,i sow applications made with it and they look great.So now i want to download it,when i go to download page it gives me a lot of packages i choose the wxWidgets 2.8.10,but when i go to SourceForge it gives me a lot of packages,which should i choose ? I choose wxAll but when i extrcact there was no Install File,only a lot of other files :S Can you tell me where can i download it and if there is not setup file,how can i install it ? And which compiler is the best for wxWidgets :) Thanks ....

What OS are you on?
If you're on Windows, then you choose wxMSW :)

I installed the wxWidgets,and now when i am trying to compile some hello world code with DevC++ like this,it gives me a lots of errors like " \Documents and Settings\********\Desktop\HelloWorld.cpp C:\Documents and Settings\********\Desktop\C wx/wx.h: No such file or directory. ",so why it gives that errors ? Which compiler should i use ? And how can i fix that ? Please help me :)

/*
 * hworld.cpp
 * Hello world sample by Robert Roebling
 */

#include "wx/wx.h" 

class MyApp: public wxApp
{
    virtual bool OnInit();
};

class MyFrame: public wxFrame
{
public:

    MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);

    void OnQuit(wxCommandEvent& event);
    void OnAbout(wxCommandEvent& event);

    DECLARE_EVENT_TABLE()
};

enum
{
    ID_Quit = 1,
    ID_About,
};

BEGIN_EVENT_TABLE(MyFrame, wxFrame)
    EVT_MENU(ID_Quit, MyFrame::OnQuit)
    EVT_MENU(ID_About, MyFrame::OnAbout)
END_EVENT_TABLE()

IMPLEMENT_APP(MyApp)

bool MyApp::OnInit()
{
    MyFrame *frame = new MyFrame( _T("Hello World"), wxPoint(50,50), wxSize(450,340) );
    frame->Show(TRUE);
    SetTopWindow(frame);
    return TRUE;
} 

MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
    wxMenu *menuFile = new wxMenu;

    menuFile->Append( ID_About, _T("&About...") );
    menuFile->AppendSeparator();
    menuFile->Append( ID_Quit, _T("E&xit") );

    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append( menuFile, _T("&File") );

    SetMenuBar( menuBar );

    CreateStatusBar();
    SetStatusText( _T("Welcome to wxWindows!") );
}

void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
    Close(TRUE);
}

void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
    wxMessageBox(_T("This is a wxWindows Hello world sample"),
        _T("About Hello World"), wxOK | wxICON_INFORMATION, this);
}

I am so sorry dude but i dont understand that guide :( I am so sad :( Can you explain me with some easyer guide ?

I am so sorry dude but i dont understand that guide :( I am so sad :( Can you explain me with some easyer guide ?

In fact, that link describes everything step by step, so I don't know whether easier is possible.

I am stuck on 2. step,i downloaded wxWidgets but i don't know where can i download imagelib,i mean i cant find imaglib in that link :S

There's this wonderfull site online recently called 'google'. Here's how to use it. The first link is what you want. :icon_wink:

Guys i know how to google but i didn't knew that i will find the answer at google.I solve the problem,those sites didn't help me,but i was dogged and i solve the problem.The point was to download wxWidgets DevPak and Imagelib devpak,and like i said those site didnt helped me because,it says: just download imagelab double click and install,i double click it but its not .exe file,so i thought,lets see compiler options,and i found DevPak installer,i installed them,edit some compiler libraries and it works perfectly now,and i learned a lesson : never give up ! Thanks to all for losing your time with me stupid problem :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.