As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What should you choose to learn cpp programming? As I know both have support for language but does that really make any difference If I have to make a choice?
At this stage, of learning afresh, you should not be worrying about compilers. Both are fine. Catching up the nuances of the compiler and if any difference does exist should occur latter, rather than at the start.
What would you make out of the differences at present when you are starting to learn the language ?
If you're just learning, I'd recommend G++ but I'd recommend you get the newest one you can. This might be a little tougher than usual on win32 (you'll probably have to hand-upgrade mingw or something). So, you might do yourself a lot of favors installing Linux on a second partition or some old PC or something.
The main reason I'd recommend G++ over VS is the implementation of the NEW bits of the language. MSVC++ has some of C++0x implemented but a huge portion of it is not. Furthermore, they got a lot of stuff wrong and/or in some sort of half-way state (and sometimes what they say is "partially implemented" is only available in their C++/CLI language, features of which they include in their list of supported C++0x stuff). G++ on the other hand is pretty much THE implementation of the new standard that people making the standard are actually implementing. It's been forked to test new features, etc, and is much, much further along in implementing C++0x than any others that I can think of.
Why learn C++0x? Because this is what the language is going to look like now. Why learn the old when you'll just end up having to relearn like everyone like me has. With C++0x extending the language and changing the language in so many ways, it almost feels like it's totally new. In my opinion you'd serve yourself well by just learning what the future is going to be like rather than the past (and in VS's case, a bastardization of the two).
I use VS because I pretty much have to. If I was a newbie today I'd learn on G++ to get all the new goodies. I totally wish I could actually use it myself.
I would recommend Visual studio 2010 express to start with, its a far more userfriendly experience where you have editor and debugger integrated, that if the goal is to learn c++ with as few other distractions as possible, you can download it for free from the link below:
http://www.microsoft.com/express/Downloads/#2010-Visual-CPP
Perhaps VS is better for beginners because it has the auto-completion feature.
Both Visual C++ and GCC are good compilers. If you want to use GCC, you might want to try out Qt Creator IDE. It has a very nice text-editor with vim builtin. On the other hand, with Visual Studio you have plenty of nice plug-ins such as Visual Assist X, ViEmu, etc.
GCC is good if you're wanting to create small programs which don't require much management, for example to just say "Hello world" or work a couple things out. Also, if you want the application to build on many systems like Linux or Mac, GCC is the option to choose.
Otherwise, if you're on Windows and want to create some massive project that needs loads of complex steps and stuff to build, Visual Studio is good.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am trying to make my first desktop app, but I am at my wit's end trying to understand C++/CLI. After several hours of trial and error, it seems to me that it is unrelated with C++( I may be wrong ). I am getting hard time making functions, classes, etc. work, and am unable to understand what is going on. So, I have decided to abandon it for the moment.
Please tell me whether I can make a GUI-enabled desktop app in "pure" C++, using just my Dev C++ compiler. Yes, it might be a better idea to use visual studio, but I want to return to it later. Right now, please tell me whether I can do it in "pure" C++, and if yes, how(i.e., any books, tutorials or some specific learning path).
And yes, the app is just for my learning purpose. So, the issues of cross-platform compatibility, etc. can be safely ignored.
Thanks in advance.
If you're stuck with Windows, some of the more popular choices are:
Microsoft MFC. Not for the faint of heart...
Qt. However, this is also not strictly ISO C++, as it requires a special pre-compilation step. But it comes with a very complete library, is cross platform and widely adopted. The documentation is excellent and the learning curve not very steep.
wxWidgets. Cross-platfrom, popular and standard C++ only. However, relies heavily on the pre-processor and code using it tends to become ugly... (that's my personal opinion...)
GTK+, which is pure C. There is a pretty decent C++ wrapper called gtkmm.
Qt is probably the best C++ GUI framework out there. It does include language extensions that are not 100% C++ but it comes pretty close. There are also tutorials to help you out.
Standard C++ does not come with a gui. There are certain libraries that you could use to create a gui in c++ such as:
Qt
WxWidgets
I hope this helps
Firstly, C++/CLI is not C++, its Microsoft's ".net that looks like C++" language. Ignore it, it was pretty much dead on arrival.
I'm not sure what you mean by "pure ISO C++", if you mean you want to create a GUI app using C++ without any special language features (eg C++/CLI) then you'll be looking at Qt nowadays. Its really rather good and is probably the best C++ GUI system there is today. You can also download the QtCreator IDE that will help you out. (its also all open source and your apps will run on mobile and Linux too!)
If you want something that is Windows-only then you could write old MFC apps (for the desktop) or if you want to be bleeding-edge then write WinRT apps. The native OS GUI features are available in both these systems.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I precise that I restrict this question to "native" development for my x86 (64bits) linux box. No embedded or non-x86 architecture.
Since I'm a C++ user and there is a C++ renaissance, I'm currently using C++ for personnal projects.
Right now I'm using the robust, traditionnal linux/gcc/make toolchain.
But through blog posts and SO questions, I recently became aware of new promising tools :
''clang'' as an alternative for ''gcc'', a lot faster, giving better error messages
''gold'' as a replacement of ''ld'', a lot faster
Those tools are less known and it's easy to not even know about them.
Are there other interesting less known tools that I should be aware of ? For example alternative to gdb or the like ? (I'm also using cmake)
I'm looking for ease of development first, then development speed improvement. Any other improvement is welcome.
Free tools if possible.
You could be interested by ccache (a compiler cache able to avoid useless recompilation, and transparently usable thru the same g++ command, just by adding a symlink inside your $PATH)
For C (but not C++) programming, you might be interested by tinycc - which compiles very quickly (but produce slowly running binary code).
When coding, the Boehm's garbage collector might be used. See this question related to using it in C++.
And also use valgrind to debug your memory leaks.
Sometimes, dynamically loading a shared object with dlopen is intersting. The dlsym-ed symbols should be extern "C" in C++. I sometimes love generating C or C++ code on the fly, compiling it, and dlopen-ing the module.
For building, consider investigating other builders, like e.g. omake.
When compiling, don't forget the -Wall (and perhaps -Wextra) flag to the compiler. The new link time optimization (with CXX=g++ -flto in your Makefile) could be interesting (but compile time suffers, for perhaps a 10% increase in speed of the executable).
If your source code files share all the same C++ header, pre-compiling that header is worthwhile.
Newer (e.g. better than C++) languages exist, like Ocaml and Haskell but also Go and D.
Use a version control system like GIT even for pet projects.
Qt is a good C++ framework, notably for its graphical toolkit.
Wt enables you to code in C++ quite quickly web interfaces.
Both GCC & GDB are still evolving. Don't forget to use the latest versions (eg 4.6 for GCC, 7.3 for GDB) which provide major improvements over earlier ones.
Consider extending or customizing your GCC compiler for your particular needs thru plugins or better yet using MELT extensions.
I know of two alternatives :
tup
ninja build
Both can replace make, because they are faster for big projects, since they do not do so extensive checks.
For replacing the make part of the toolchain I recommend waf which is fast and has a small footprint. The support is quite good as well.
I've tried gold which was not that faster than ld, but seems to be promising. It does not seem to be really maintened though, last time I've checked.
clang seems quite promising, but I have not tried it in a production project. I plan to, as its well thought design leads to really fast development. I plan to use it to switch to C++11 ^^
my2c
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
My native language is not english, so please sorry my mistakes.
I'm doing a course of free technologies and recently I've been learning Linux and it seems promising, however, I couldn't find good development tools, something like Visual Studio.
After trying a lot of other IDEs, none of them gets close to MSVS functionality.
I know it's not easy to develop a good IDE, but there are dozens of "almost-there" IDEs, I wonder what they could do if the developers had joined efforts.
Also, I'm just wondering... Why the open-source community doesn't have a good IDE on top of the priority list.
After researching a little, I found a lot of articles describing how the OS community works, they always break apart, when things are getting usable they just dissipate and begin to work on more unusable things.
This made me very sad, because I thought open-source were serious stuff, and that's why I choose the course on free technologies, now I'm almost decided to give up.
There are hundreds of Linux distros, and hundreds of similar software that does almost the same thing, from desktop environments to python scripts, people are reinventing the wheel. Open-source is quantity and not quality.
If I can't find a good C++ IDE that has the features I'm used to, I'm going to give up. I'm not a genius geek, just a normal or maybe dumb guy who programs in C++ and is used to tools that facilitate the development. Emacs, Vim, all that stuff is too much for me. If that were the only tools available for programming, then programmers would be the rarest persons in the world because you need to be a super-genius to use these tools.
The features I want in a C++ IDE are:
-Good code highlighting
-Pop-up documentation
-Good debugger with visual aid
-Usable and smart code completion
Thank you.
I think what you're encountering is a difference in culture. Surely there would not be the amount of free and open source software that exists if nobody had the tools to develop it. But the people who are developing it are mostly used to a very different flavor of tools that what folks brought up on Visual Basic are used to. Emacs, ctags, make, gdb, strace, ltrace, and so on are all very powerful and much more natural to somebody used to unix than a MS-style IDE... and I hesitate to simply say IDE, because many FOSS developers consider emacs itself to be an "IDE".
Perhaps your question would be more productive and less inflammatory if you instead asked "Why are there no open source MSVS-like IDEs?"
I agree with Diego Sevilla comment.
My first experience as developer was with Visual Studio and that skew my way of work.
Like my mind was trying to use something equals to Visual Studio, but that is only an habit.
After Visual Studio I moved to Eclipse, I loved it! at that times with visual studio and subversion you needed an external tool! (today exists some tools out there).
Now I am using vim, why? ultra fast, customizable and minimal (if you want).
But the best best example of open source IDE is smalltalk, I wish all programming lenguage came with the tools smalltalk provide.
Um, get Eclipse or Netbeans. Both are great free IDEs with millions of users.
There are many open source IDE's. Check out http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments You can see some of the licenses.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I teach programming at secondary school: this is our current status and I would appreciate any suggestions:
We have programmers club for advanced students. We develop in MSVC# (even commercially) and NetBeans, everything works fine
However, two thirds of the class are not developers: they are otherwise oriented, their job will probably not be in IT
According to our school agenda, we HAVE TO teach them some basics
So in the first year of their studies, we teach them something like "programming for dummies" to give them time to decide what they really want to do (programmers club requires to do MUCH homework)
The language HAVE TO BE C++ (for many reasons). Currently they develop in C++ Builder 6.0, which is slow and buggy in our school network.
So what would be the best solution for those students? The requirements are fast, reliable and very easy to undestand IDE. Console output is sufficient, something like "editor and play button". Visual programming and debugging tools are not required. The IDE should be free, preferably running on Windows.
My favorite was MSVC 2008 Express - it is really fast and pretty simple. But C++/CLI is not C++ (managed code is not the basics), so this is not an option. Any other suggestions?
You said it right there: go with Visual C++ Express.
Just because you can use it to write C++/CLI projects doesn't mean you have to. Just create ordinary Win32 console apps and you'll be using plain old C++, nothing managed whatsoever.
To clarify: C++/CLI is what you get when you create a Windows Forms, Windows Presentation Foundation or some other type of .Net-based application. If you create a Win32 Console Application, you will be using ordinary C++ without any of the managed Microsoft extensions.
Visual C++ Express does support native C++ developement. I would strongly urge you to upgrade to the 2010 version to gain some C++0x support; C++0x makes it much easier to program in C++ without touching the nasty bits.
However, C++ as a first language sounds daunting. Particularly for those without any further programming aspiration; it's complicated, easy to misuse, and will blow up with poor error handling in hands of beginners.
For some casual programming introduction, I'd recommend something like JsFiddle: they can do it from anywhere with no special tools, and whatever they learn they might even be able to actually use as non-IT guys. It's also much more fun to get immediate feedback when learning something, which is another mark against C++.
So if you have to use C++, use C++0x to make stl algorithms "just work" using lambdas and avoid iterator complexity using the range-based for (amongst other improvements).
I've worked with:
Eclipse for C/C++ Developers (at work and at home)
QtCreator (at a side project I was working on while working)
Microsoft VS (at work)
Code::Blocks (on my home laptop, with Eclipse, for fun)
vi (at work and at home)
Notepad++ (at home)
KDevelop (at home)
I think for the beginner, in my personal opinion of course, the Eclipse, MSVS and Code::Blocks are equally great. When stuff starts getting more complicated, you need to choose based on direction. If you're developing for Windows - stick with MS. If you're developing with GCC - stick with either Eclipse (Which is kindof heavy but powerful) or Code::Blocks (which is way lighter but not as sophisticated). Use QtCreator if you're doing GUI for anything with Qt, otherwise I wouldn't keep it.
Code::Blocks is the one I usually recommend for beginners. I'm not a big fan of the Eclipse CDT since I've always found it needlessly complex under Windows.
Since it uses gcc under the covers, you won't find any of those "helpful" changes Microsoft made to the language, like their so-called safe functions, which are nothing of the kind, and which render your code unportable.
If you don't want to scary students with nasty or bulky look of IDE. Choose qt-creator. It's looks nice. Looks simple, but at the same time is very powerfull.
I would have to recommend QtCreator, and it's a good thing to teach them to use a cross-platform GUI toolkit.
It sounds like you want Eclipse for C/C++ Developers.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Are there any reasons why I shouldn't use Visual Studio 6 for C++ development?
Where can I find some resources why this would or wouldn't be a good idea?
Are there any lists of issues I would have with this?
I wouldn't say that Visual Studio 6 should "never" be used for C++ development. I would say that it should "no longer" be used for C++ development. Reasons:
Microsoft's later compilers (particularly Visual Studio 2008) are much more compliant with the C++ specification.
Microsoft's later compilers add better warnings and errors. These are useful when looking for potential security problems with your code.
It's no longer supported. Newer releases of the Windows SDK don't work with Visual C++ 6, so you won't be able to use newer features in Windows without extra work.
To summarise: stop using Visual C++ 6. If you have to use a Microsoft C++ compiler, use Visual Studio 2008.
std::string multicore/proc issues in the runtime, re: KB813810
poor STL support
even poorer Standard C++ support
Don't do it.
Visual Studio 6 is fine, if you want a fast, lightweight environment with a good debugger. The problem is the C++ compiler that comes with it, which is very outdated. After many years as a happy VC++ 6 user, I've now switched to Code::Blocks, which gives you a similar IDE but allows you to use the up-to-date g++ compiler.
I think the main reason for Visual Studio falling out of favor for C++ development is because of it's age. The compiler has also been improved significantly since then.
I taught myself C++ on MSVC++ 6 when I was in middle school. To my horror, I discovered my current company still using it. I causes us endless pain, mostly regarding templates failing to compile. We get great internal compiler errors. Oh, and the mutable keyword doesn't seem to work. There's also tons of standards compliance issues, some of them quite serious, like my favorite:
for (int i = 0; i < 10; ++i)
{
// do some stuff here
}
cout << i; // THIS COMPILES AND WORKS! i is in the function scope, not the loop scope.
I found a fairly nice list of bugs and misfeatures in MSVC++ some time ago in an attempt to convince my boss to transition away... here's the link.
If you believe the MS hype, Visual Studio 2010 will be greatly enhanced for C++ development, and include much of the Visual Studio 6 functionality that was lost in later releases. I personally find Visual Studio 6 to be a very productive C++ development tool, to the extent that I still use it for much of my development, and do final compiles and testing under VS2008. My reasons for doing this are given in a previous question here
Current VS6 user here. We are transitioning away this year, but I'm still using it today.
I pretty much agree with what I'm seeing said here. It sucks.
One thing I've seen hinted at here, but hasn't been said explicitly, is that some of the more interesting features of the STL are all but unusable in VS6. As near as I could tell, this is mostly because the compiler has a lot of trouble figuring out implied template parameters. For example, pretty much everything in std::algorithm is going to either be totally unusable, or require so much explicit instantiation that it would be easier and cleaner-looking to just write the code by hand.
Boost can help a bit with this, but a great deal of Boost will be unavailable to you too. :-(
Ok, vs2005 and upwards provides standards compliant c++ and a better IDE (I find the intellisense a little less buggy for example).
That said if standards compliance doesn’t bother you, you only develop managed code and your projects are very UI orientated you may prefer VC6 (class wizard is awful on vs2008).
Personally, as poor as class wizard is, I would still go for the later IDE. The benefit of better source control integration, the ability to use third party plugins, etc still outweighs the cons.
Another reason not to use Visual Studio 6 is that it is no longer supported by many open source libraries (ACE framework for example). Also if you use Visual Studio 6 you should apply all the patches because some code it is not compilable without those patches. The template support is not very good.
As a conclusion: I would recommend using modern/newer C++ compilers.
Main reason: vc++ 6 have poor standard support.
As result some of libraries couldn't be compiled by this compiler.
And your project will have truobles when you will decide to compile with other compiler.