Alright I've been programming in Java for over 3 years now and feel it's time to switch to C++. In Java I used an assortment of IDEs, but stuck with Eclipse once I found it.
So, I've gone through about 5 different C++ compilers (Dev C++, Turbo C++, to name a few) and was only to get one Hello World compiled without any clue how I got it to work. I also tried the Eclipse CDT but that also didn't compile.
I'd hate to say it, but Eclipse making it so easy to compile Java code has made me very dull when it comes to these things. So what I'm asking is if someone can suggest a compiler and go into the process of compiling in C++. I hear things about makefiles and .o files, but I'm not really sure what it means. Any help would be grateful.
Thanks in advance.
Name:
Anonymous2007-05-16 20:11 ID:69jOUPBp
Dear god, I hope you're a troll
Name:
Anonymous2007-05-16 20:30 ID:3NJWDPu5
Maybe, but what the heck. Java does make one dull. So, C++ IDEs:
Code::Blocks seems decent.
MS Visual C++ is pretty much the standard.
If you don't mind the AIDS Microsoft's Visual Studio is nice for C++ development.
I prefer Code::Blocks and GCC myself, just download the last stable from the C::B page, it comes with the needed compiler and libraries, then go to the forums and get some recent build of the IDE itself.
Name:
Anonymous2007-05-17 5:29 ID:86ZWxSx2
Visual Studio is great, I don't know why so many of you guys have a problem with it
Name:
Anonymous2007-05-17 7:01 ID:dpT+1SDT
why not give both a try before judging either...?
Name:
Anonymous2007-05-17 7:08 ID:Q1X5/cYf
kate and g++ suits me fine.
g++ helloworld.cpp -o helloworld
(Without "-o helloworld" the binary is saved as a.out)
>>11
Yeah, that's great - if you have only one source file, use no libraries, and don't need any compile options. So, real nice Hello, world setup there. Except for the Kate part. And why wouldn't you just type gcc?
Name:
Anonymous2007-05-17 17:46 ID:0i4+hZMI
devc++ for the win
Name:
Anonymous2007-05-17 18:22 ID:gYl9eWle
VS pwns.
Name:
Raghar2007-05-17 22:12 ID:XLv2bAvq
Have you tried command line MSVC, and ECLIPSE? Thought it's funny you are going from advanced language (with multithreading defined in standard libraries, and correct memory model) to something outdated. It will bite you when you'd be making multithreaded applications.
BTW macro assembler is easier than C++, why don't play with it a little?
Name:
Anonymous2007-05-18 5:33 ID:RSRt1CjQ
C++ is nasty D:
Someone, kill Stroustrwhatever fag came up with it.
Name:
Anonymous2007-05-18 6:45 ID:2xsWPLgG
>>15
Google up boost::thread, you may find threads a lot easier to do with that.
>>20
I'd make it be C. It's a low-level language, portable assembly for fuck's sake. You don't want objects, generics, etc. in a low-level language because it doesn't have the support for it; these good features become nasty features and bite.
I'd make it be C, then we could talk about a high level langauge with these features and even more, implemented in a decent, elegant way, without biting. Then we'd realize there's something better than this anyways, it existed long before C++, and before C. Dynamic languages. Lisp. Python. Ruby.
So you stick to C for low-level systems programming, performance-critical sections of code, and portable assembly, and use a dynamic language for UIs, scripting, and non-performance-critical tasks. Things would be so simple if people used the right tool for the right job. However, pretty often you see them using low-level languages for high-level stuff (C++ for GUI applications), or high-level languages for performance-critical tasks (Java for network application clients supposed to run in the background; Azureus I'm looking at you).
Name:
Anonymous2007-05-18 16:26 ID:2xsWPLgG
>>21
C++'s "generics" are based on templates, which are just a convenient way to avoid writing the same thing twice, thus
template<class Type>
Type harbl(Type a, Type b){
Type tmp;
// harbl the harbl a bit, or just do something
return tmp;
};
....
int e = harbl<int>(f,g);
float f = harbl<float>(a,b);
is just a convenient way to avoid writing the function harbl twice. The template implementation doesn't include anything that would make it unsuitable for a low-level language, it's basically a smart preprocessor that in this case generates separate code for both harbl<int> and harbl<float>.
The objects have their problems, sure, but those are not _that_ common unless you're using the language like an enterprise Java/C# programmer and the code turns into a mess of randomly glued together objects in the absence of any design effort.
>>23
Win32 API is a huge mess in general. Just about every operation requires filling some obscure data structure originally meant for Windows 1.0 but later extended by creating things like PEFGSTRUCTWINDOWHANDLEFORMATDATAEXTENDED to replace the PEFGSTRUCTWINDOWHANDLEFORMATDATA struct while retaining some backward compatibility. Also, since the structs don't fill themselves in unlike decent objects would with constructors there's shitloads of NULL and bizarre #define constants all over the place in any code that actually does something. Vista probably adds yet another layer of shit on top.
It's almost tolerable when used through .NET and its Windows.Forms but it's still not platform-independent (fucking retarded given it's a high-level API).
Personally I just use wxWidgets and C++, not very pretty looking code (and since there's no standard way to do unicode with C++ I have to write unicode wrappers and other shit by myself), but at least it'll compile and work on most operating systems out there with minimal fixing once written.
>>3
it does make you dull, because ide's like jbuilder(based on eclipse) auto-completes so much of the code for you that when i was in my required java class, i didn't have to know what did what, i let the ide do that for me. the end result, i didn't learn anything that i was supposed to learn.
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy