Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Compiler Issues


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 reklessEngi   Members   -  Reputation: 100

Like
0Likes
Like

Posted 08 February 2011 - 02:49 AM

I am just starting to learn C++, so I purchased a few books to help me get started. The one that (by far) makes the most sense is Beginning C++ Game Programming by Michael Dawson. Early on, he recommends using Dev-C++ to compile all of his sample code, and it has been working fine. However, sample code from other sources (I forget which, but I can probably find it if requested) is failing to compile. Clearly I need to understand why, but before I do, I would like to decide on one compiler and stick to it from here on out.

From the text:
"I hate to pick on any particular compiler or software company, but I have to say that I cannot recommend Microsoft Visual C++ 6.0. Its compiler fails to correctly implement C++ in some important ways. As a result, a few of the programs in this book will not compile under Visual C++ 6.0. I do my best to point out the issues when they arise in the programs in the book. If you want to go with Microsoft, I recommend their current line of Visual Studio .NET products, which implement the C++ standard quite faithfully."

So first of all, I realize that this text was written in 2004 and that things may have changed significantly since then. But another text (even older, from 1999), mentions that although C++ was standardized back in 1998, compilers do not necessarily adhere to the standard. The above except seems to validate that. With that in mind, are there significant differences between Dev-C++, Code::Blocks, and Microsoft Visual C++ 2010 Express? Also, I recently installed the 64bit version of win7. I've always programmed in a 32bit OS, so is there anything different I need to be aware of when using these compilers?

Sorry if some of this has been addressed before. I did search and found some information, but many of the posts were as old as my source material and may be just as irrelevant today. This is all so confusing to a beginner like myself.

Sponsor:

#2 Erik Rufelt   Members   -  Reputation: 1988

Like
0Likes
Like

Posted 08 February 2011 - 03:43 AM

Use VC++ Express 2010, it is a a very good compiler and IDE, and doesn't have any of those problems. Do not use Dev-C++.
You can compile and run 32-bit apps as normal on your 64-bit OS.

#3 telaryus   Members   -  Reputation: 139

Like
0Likes
Like

Posted 08 February 2011 - 04:21 AM

I personally don't recommend any one compiler over another for the simple fact that you are always going to run-into issues in terms of implementation-defined behavior. i.e. The developers for the compiler are free to choose what to do given certain circumstances. And this isn't an issue with the standards, it's more of an issue with what would happen if the standards were too strict.

There is nothing wrong with Dev-C++, I think bloodshed did a good job developing their environment. Only thing I could recommend if you are having issues is to make sure you have the most recent version of the GNU compiler.

Microsoft's Visual Express is nice and their compiler has been around for about as long as the GNU's compiler. They both adhere to standards, except for some places where standards are not strictly specified and left to the developers to decide.

I don't have first-hand knowledge of Code::Blocks so I wont comment there but Borland's compiler isn't bad either.

And to be honest about the whole compiler issue, using more than one can be very beneficial. You'll pick up on things that you might not normally think about by seeing how different compilers handle the same code in areas where standards aren't strictly standard.

Side note: All compilers can be run via command-line and Makefiles are awesome. Not to mention this will make you understand what all of those compiler and linker flags actually do. =D

--------

In terms of compiling 32-bit on 64-bit os, should have a problem, be forewarned though that Microsoft's default project settings are for Unicode character sets and not multi-bit (MBCS) which is going to be the difference between how text is interpreted. Especially if you start dealing with Windows Platform SDK.
"My word is my bond and here I stand."

#4 mhagain   Members   -  Reputation: 3828

Like
0Likes
Like

Posted 08 February 2011 - 06:54 AM

So long as the compiler is doing it's basic job of compiling code OK, I'm thinking that the choice of IDE should be more influenced by how nice it is to use and the supplementary tools and features that come with it. These are all things that lead to better developer productivity, and getting stuff done is what you'll stand or fall by at the end of the day.

My personal weapon of choice is MSVC 2008 these days and for these reasons. Code::Blocks is also quite fine and respectable enough, but has what I'd consider some basic usability glitches that would rule it out for me. MSVC's auto-hiding of GUI elements and it's vastly superior debugger just make it the obvious choice.

I'd second the "using more than one" recommendation upthread. I've definitely caught subtle bugs this way in the past, and it just leads to more robust code overall.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#5 DeathCloud   Members   -  Reputation: 100

Like
0Likes
Like

Posted 08 February 2011 - 08:17 AM

I've used sun's Netbeans ide for a long time, it's interface and usability are respectable. It's got the option to integrate pretty much any useful C++ compiler, Intel, Borland, Mingw (GNU), Sun Studio...
Notepad or Emacs are pretty helpful to the beginner. Using only a text editor and command window should keep you from getting too spoiled. ;)

#6 jbadams   Staff   -  Reputation: 8926

Like
3Likes
Like

Posted 08 February 2011 - 08:22 AM

There is nothing wrong with Dev-C++, I think bloodshed did a good job developing their environment. Only thing I could recommend if you are having issues is to make sure you have the most recent version of the GNU compiler.

I'm sorry, but this is just plain wrong. There is a LOT wrong with Dev-C++; you're talking about a development environment last updated in 2005 (SIX years ago) which contains (according to it's source-forge listing -- so this is just what the author knew about) 340 bugs. To be clear, these aren't compiler bugs, these are problems with the development environment -- on top of that it also comes with an extremely out-dated compiler, but even if you update that you're still stuck with all the remaining bugs. Dev-C++ is also not generally held in good regard by the programming community any more, and apart from the many technical issues with it you'll have to deal with being told to update every single time you mention you use it.

Why you shouldn't use Dev-C++. Dev-C++ was a good option when it was released. It is not -- and has not been for a long time -- anymore. Do yourself a favour and just let it go. There are freely available alternatives that do not suffer from the same problems, and if you really love Dev-c++ you can even consider wxDev-C++, which is based off that same code but is much more modern and is still supported.

#7 telaryus   Members   -  Reputation: 139

Like
0Likes
Like

Posted 08 February 2011 - 01:08 PM

Wow... way to take that way to personally.

The statement remains valid.

Dev-C++ is not by any standards a bad IDE. Not to mention that that is your own blog post. Maybe if you wanted to make a more valid argument you should try not being a holy-war fighting narcissist.

It has bugs?! Holy crap you must be shitting me! Oh wait, so does VS. Did you know that most developers don't use VS2010. You want to know why? Because it's buggy as all shit. It isn't stable enough to risk having a project fall flat because of little issues that previous versions of the IDE don't have. Here's a list of the bugs that they had found thus far since last year: http://blogs.msdn.com/b/jasonz/archive/2010/12/20/visual-studio-2010-service-pack-1-beta-feedback.aspx. And even with all of those fixed there are bound to be more.

But in the end it's software. Of course there are going to be bugs but that doesn't mean that a tool is any less a tool. And as for debuggers, there are plenty of options out there (GDB, winDbg are two valid choices.) But you'll probably flame at me about those too. But wait! Oh right, winDBG still used even given the fact that it's not a fancy shmancy visual debug tool. Why? you might ask. Because regardless of which it is a good tool.

----

To the OP:

Regardless of everything. Try things out for yourself. If you find an IDE or other application to code in that you really like. Learn it and know it inside out. With everything that is available one option might be more appealing to you than another.
"My word is my bond and here I stand."

#8 Palidine   Members   -  Reputation: 1258

Like
0Likes
Like

Posted 08 February 2011 - 01:22 PM

Dev-C++ is not by any standards a bad IDE. Not to mention that that is your own blog post. Maybe if you wanted to make a more valid argument you should try not being a holy-war fighting narcissist.


It is actually a "bad" IDE just like Visual Studio 6 is a bad IDE. It's very old. Code::Blocks is the modern continuation of the Dev-C++ project line, so at least use that so that you are using a new and "supported" tool. In short: even the people who wrote Dev-C++ don't use Dev-C++ anymore, they moved to Code::Blocks.

-me

#9 jbadams   Staff   -  Reputation: 8926

Like
1Likes
Like

Posted 08 February 2011 - 07:07 PM

Wow... way to take that way to personally.

I'm sorry, but I don't see responding with a few facts about the IDE in question as "taking it personally".


Dev-C++ is not by any standards a bad IDE.

I take it you don't consider hundreds of bugs a standard by which software can be considered bad?

I would say containing a large number of bugs is a pretty objective measure of software being bad -- and whilst you are entirely correct that there are also plenty of bugs in the latest visual studio, there is a large team of software developers working to fix those bugs -- no one is working to fix the bugs in Dev-C++, it hasn't been touched for years. You might also notice I recommended VS 2008 Express in the my linked blog post, and with a little thought might realise that the post is aimed at those looking for free IDE options -- I do not expect and never stated that a lot of professionals would be using this package -- I do however know that there are very few using Dev-C++.

Not to mention that that is your own blog post.

I never represented it as anything else -- my name is plainly there in the url for anyone to see -- I fail to see how that makes the contents any less valid. It isn't uncommon in this community (and others) to make blog posts and link to them when responding to commonly arising questions or issues. The post in question is also quite commonly linked to by other people when responding to questions about Dev-C++, suggesting it is at least reasonably well thought-of.


Of course there are going to be bugs but that doesn't mean that a tool is any less a tool.

No, it doesn't, but it does mean that tool is less good than a tool that has less bugs, or which is at least being worked on to remove the bugs.

Given the choice between an old hammer where the head is not firmly attached to the handle, or a shiny new hammer with a firmly attached head, which would you recommend someone use? Personally, I would recommend the new hammer, and without a good reason otherwise I will always recommend the newer, maintained tool. Code::Blocks, newer versions of Visual Studio, or wxDev-C++ are newer tools which are being actively maintained. Dev-C++ is old, and has problems that are not going to be fixed.


And as for debuggers, there are plenty of options out there (GDB, winDbg are two valid choices.) But you'll probably flame at me about those too. But wait! Oh right, winDBG still used even given the fact that it's not a fancy shmancy visual debug tool. Why? you might ask. Because regardless of which it is a good tool.

Actually, we agree entirely, and I'm not sure why you brought this up -- I never said that "fancy schmancy" visual tools are better than other options -- what I said was that old, broken tools should not be chosen given the ready availability of modern options which are in good working order.

GDB is an excellent tool. The dated, buggy version that ships with Dev-C++ is not, and it is neither trivial for a beginner to replace this with a more modern version, nor obvious that they might wish to do so.


I'm going to specifically state that I am not speaking as a moderator here, just to avoid any potential confusion, and that I will not perform any moderation in this topic:
With that in mind, I'm going to respectfully ask that should you choose to respond to me again you please respond to the facts I've stated rather than trying to make me come off a ranting zealot; I believe I have sound logic behind what I'm saying here, and I'm willing to listen if you can refute my points rather than simply attacking me.

#10 Hodgman   Moderators   -  Reputation: 13586

Like
0Likes
Like

Posted 08 February 2011 - 07:27 PM

Wow, too much QQ in here. Telaryus' flaming QQ specifically.

MSVC v6.0 had a completely non-compliant C++ compiler. It was leaps and bounds better by MSVC 2003, and by MSVC 2005 there were no real practical non-compliances left (that I came across, anyway).

Over my console-games career: in 2005 we used MSVC 2003. In 2008 we updated to MSVC 2005. In 2009 we updated to MSVC 2008.
I've also had to use some other IDEs, like Code::Blocks and Code-warrior (eughhh...)... and they don't come close to the usability of MSVC + Visual Assist.
At home I use MSVC 2008 express.
if( compiler.age > years(5) || IDE.maintained == false )
  upgrade();


#11 reklessEngi   Members   -  Reputation: 100

Like
0Likes
Like

Posted 09 February 2011 - 03:30 AM

Didn't mean to start a flame war here, but thanks for all the info. I'm glad to know that MSVC is no longer non-compliant, as that was a good portion of my concern. I also didn't realize that Dev-C++ was no longer maintained, and since I don't know my tail from a hole in the ground when it comes to C++, I think using a current compiler would be one less thing to confuse me. And compiling using the command line sound like a really good idea; my only experience coding is with FreeBASIC within an IDE, so I really don't have a clue what compiler and linker flags even are. I think I will use MSVC and keep code::blocks handy as a learning tool. Thanks again, guys.

#12 AndyEsser   GDNet+   -  Reputation: 319

Like
1Likes
Like

Posted 09 February 2011 - 06:34 AM

I'm afraid that I'm going to have to agree with jbadams on this. He has not taken it personally, he is simply stating facts. As a moderator and a respected member of the community you should listen to his comments, if you continue to use Dev C++ afterwards, then that's your choice.

If you start a post on here, and you mention you use Dev C++ you will almost certainly receive responses telling you it would be best to upgrade. If a large amount of the community is against a particularly Compiler, piece of software, Colour in the rainbow, chances are it's for a good reason.

Think of it this way, try phoning Microsoft up and saying you're having problems getting USB 2.0 to work on Windows 95, the first thing they will say is update to a more modern Operating System. This isn't because Windows 95 was a bad Operating System when it was released (in fact, quite the opposite), it is because over time, bugs and issues appear, and can result in problems. Usually, from my experience, most issues people post and they mention they use Dev C++ are either cured by upgrading to Visual Studio or another IDE or at least help them in fixing the problems.
Developer
Blitz Games Studios

[ Events 4 Gamers | NeHe OpenGL Tutorials | LinkedIn | Development Journal | How To: Debugging | Twitter: @LeadHyperion ]

And as they say, what happens in Las Psyche, stays in Las Psyche -Ravyne
Often the bliss of not knowing is an important part of maintaining sanity. - frob

#13 NicoG   Members   -  Reputation: 145

Like
0Likes
Like

Posted 09 February 2011 - 06:58 AM

What Andy said.
Dev C++ was good when it was released, thanks to the Authors for contributing to the people during their active time, but now please let this software rest in peace.

There are a lot of good alternatives out there. I personally bought Visual C++ 2008 Professional, since this IDE is really great and I don't feel like updating to 2010 yet. Maybe next version. There is also Code::Blocks, Codelite, the already mentioned wxDevC++, EclipseC++ and othes. So try them and make your choice :).
If you say "pls", because it is shorter than "please", I will say "no", because it is shorter than "yes"
http://nightlight2d.de/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS