ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hey there, I want to get into programming c++ in linux. Can anyone recomend a decent ide, ( not emacs.. erw ), something like MSVC would be brilliant, I love the fileview, workspace enviroment.
I primarily learn from staring at other peoples code - can you recomend a decent site where I can get this sort of code ? www.pscode.com was wicked, but at lot of code has loopholes, and is for MSVC only.
C++BuilderX.
It's available for all platforms, Windows, Linux and solaris. That means you only have to learn how to use IDE once for all platforms. And it includes GNU GCC compilers and borland C++ compilers. You can choose any compiler you like to compile your code.
I evaluated Borland C++ Builder 6 once, while working for a software company that wanted to switch from Powerbuilder7(which is a piece of crap) to some other programming environment. The platform they used was Windows2000. I can only discourage people from using it. It's a buggy piece of crap based on Pascal (Delphi) libraries. It looks nice, but as soon as you try to do something seriously, you get exceptions all over your poor body or it simply crashes.
I don't understand why people want to use C++ to make GUI applications anyway? It's much easier to use some interpreted language or a 4GL for that and build the application's engine in C++.
if (programming for Windows)
use Microsoft's .NET stuff && plan a couple of years to learn the framework);
elseif (programming for multiple platforms)
use java || Delphi/Kylix (never used that one myself) || perl ...;
else
use g++, Qt, GTK2,....;
Well C++BuilderX is not CBuilder 6.
Borland has finally realised the problem with CBuilder 6.
C++BuilderX is a brand new product that as got nothing to do with delphi.
It is using WXWindows as underlying toolkit. But it is very expensive.
But I wonder why does anyone want to moveonto anything if they have KDevelop ?. It is very capable and free and almost standard on all distros (That include KDE) and includes almost VC-like interface.
Originally posted by technowax hey there, I want to get into programming c++ in linux. Can anyone recomend a decent ide, ( not emacs.. erw ), something like MSVC would be brilliant, I love the fileview, workspace enviroment.
Thanks.
I use wxWindows library, wxGlade to develop the GUI, SciTE to edit the code and g++ as compiler. It works just great.
Also, if you don't care about being cross-platform, Glade + GTK is a very good option.
Something to do with complying with the new ANSI C++ standard - you can still include the old C header files by preceding with a c - ie stdio.h becomes cstdio.
As Martin mentioned, with # include <iostream> etc , you'll need to use namespace std as in the code below:
Code:
# include <iostream>
# include <string>
using namespace std;
int main()
{
char name [75];
cout << endl;
cout << "Hello LQ member!" << endl;
cout << endl;
cout << "Please type in your Username, and then press enter:" << endl;
cin.getline(name, 75, '\n');
cout << endl;
cout << "Hi " << name << " - hope you enjoy your time at LQ." << endl;
cout << endl;
return 0;
}
Hi again. Sorry, I've been out of town for a couple of days. The code from Skyline works, but I would like to point out two different solutions that don't open the namespace wide open.
Solution 1:
Code:
#include <iostream>
using std::cout;
using std::endl;
int main(void)
{
cout << "Hello world" << endl;
return 0;
} //int main(...
The purpose of a namespace is to avoid name clashes in big projects. I suggest reading the chapter on namespaces in your C++ textbook.
If you have no C++ textbook, I would suggest that you get a copy of C++ Primer (Lippman / Lajoie) and notThe C++ Programming Language (Stroustrup). Anyone who has (tried to) read a Stroustrup textbook can tell you why.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.