Solved

Good C++ Book

Posted on 2001-07-28
6
225 Views
Last Modified: 2010-04-21
Hi,
I've programmed C++ (with MFC) for Windows for about 2 years, but now I'm making the switch to Linux. I'm looking for a good book that could teach me how to program C++ for Linux.
0
Comment
Question by:zxcvzxcv
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:XTerm
ID: 6331181
Well, the ANSI C++ si exactly the same, but MFC does not exist in Linux. I recommend (since you know MFC) to buy a book on QT.
0
 
LVL 1

Author Comment

by:zxcvzxcv
ID: 6332218
To run certain KDE apps I've noticed that I needed to get certain QT versions, and libraries, what exactly is QT?
0
 
LVL 2

Accepted Solution

by:
XTerm earned 25 total points
ID: 6333489
Qt is a platform independant extension of C++. It does basically the same as MFC,but it has some great advantages over MFC. For example, Qt runs on all platforms who have g++, then GNU c++ compiler. (That are almost all Unixes, MacOS X, and windows can compile Qt as well.) A Qt program written in linux, will compile and run on windows and on Mac, a program written on a Mac, wil compile and run on windows and linux etc etc. That means you write one program, and you target almost everybody as a potential clinet.
Another benefit is its extreme power and ease of use. You dont have to write all that shitty code in capital if you know what i mean, that just wastes time and has no programming benefit.
The hello world example (compare this code to the MFC hellow world adn you'll be convinced :))

#include <qapplication.h>
#include <qlabel.h>

int main(int argc,char **argv)
{
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:XTerm
ID: 6333521
Ow, Sorry, I was copying some files, and my system gets very laggy then, accidents happen
Here is the example...

#include <qapplication.h>
#include <qlabel.h>

int main(int argc,char **argv)
{  
   QApplication *app = new QApplication(argc,argv);
   QLabel *l = new QLabel("Hello world",0,0);
   app->setMainWidget(l);
   l->show();
   app->exec();
   delete app();
   return(0);
}

Voila that's it. KDE has a wonderfull program named KDevelop, it's an C++ IDE that I believe is better than the VC++6 IDE. Qt 's events are handeld through signals and slots. For example you can connect a button's click signal to a function. It's done with one line of code. Very easy. Qt comes with excellent documentation in HTML or PDF.

www.trolltech.com

Cheers
0
 
LVL 2

Expert Comment

by:XTerm
ID: 6333538
One must-have C++ book is "The C++ Programming Language" from Bjarne Stroustrup. The one I got is from Addison Wesley. An excellent book, but not intended for newbies.
For Qt I got "Qt programming for Linux and Windows 2000" from Patrick Ward, Published by Hewlett Packard??Professional Books.

Cheers again
0
 
LVL 1

Author Comment

by:zxcvzxcv
ID: 6336732
thank you very much!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question