Solved

Good C++ Book

Posted on 2001-07-28
6
221 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now