C++11 full support on Eclipse [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am trying to find a way to get full C++11 support on Eclipse.
In Eclipse Juno I had a lot of new features with __GXX_EXPERIMENTAL_CXX0X__ but I didn't find support for std::threads, std::mutex, etc.
How can I have completion for all C++11 functions?
EDIT : Solution
Go to Project -> Properties -> C/C++ General -> Path and Symbols -> Tab [Symbols].
Add the symbol : __cplusplus with the value 201103L

Eclipse works with C+11 support (Indexer and such) just fine: both Juno and Kepler. The thing is that you have to let Eclipse know that you are going to compile with C++11 support. This is done by providing additional flag -std=c++11 to CDT GCC Builtin Compiler Settings in C/C++ -> Build -> Settings -> Discovery [tab] so it will read something like:
${COMMAND} -E -P -v -dD "${INPUTS}" -std=c++11
And that is all you have to do with Kepler/Juno to get C++11 code highlighted correctly.
Note, this is workspace-wide setting. You can do the same on per project basis if you don't want to set it in workspace.

Is there even a compiler which fully supports C++11? If you are on Windows, then I think you should give Microsoft Visual Studio Express Edition 2013 a try. Its C++11 support is not complete but IMO fairly good, and it looks like it will get even better in the near future.

Related

c++ 14 compiler for OS X [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
can someone recommend a compiler that supports c++ 14 on the OS X platform? I'm studying programming and principles by Bjarne Stroustrup and need some assistance with acquiring the appropriate compiler for the context of the book (c++ 14).
The best compiler for use on OS X is clang. C++14 is fully supported in clang as of 3.4: http://clang.llvm.org/cxx_status.html.
The current Xcode 6 betas come with a 3.4 based clang so you can just use that.
(Source: I am a compiler engineer working at Apple)
You should install Macports and then you have a choice of GCC 4.8 or 4.9 and Clang 3.5 or 3.6 by simply typing:
$ sudo port install clang-36
or
$ sudo port install gcc49
Note: you'll want to have Xcode installed first.
The standard compiler provided by apple is Clang. Here it claims it is c++14 aware:
http://clang.llvm.org/cxx_status.html#cxx14
To get it available I think the easiest way is to install Xcode.

Code editor in Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What would be a good code editor for Linux (I use Ubuntu 14.04 LTS) which combines:
auto completion for c/c++ (more is better)
syntax highlighting
recognizing include commands and getting the code from the headers
not an IDE, rather something light
simple installation
I am not a big expert in Linux and, for example, it got too expensive for me to install SublimeClang plugin. Another thing is that I want to write the code and then run the compiler commands myself, not just by pushing a button, which is common in IDEs. Also, I don't like VIM.
If you do not want an IDE then I suggest you install Wine and then install Notepad++.
I suggest Eclipse CDT. It is a C++/C IDE that is quite lightweight and does everything you've asked. Plus it has a compiler. The instillation is quite easy. Go to the software installer and search "Eclipse CDT" and then install "CPP"
Another one, that is also an IDE but a little be more environmentally friendly is MonoC++
Also, there are online editors, such as Ideone and CompileOnline

What do these common C++ compiler flags do? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm a starter in C++. I'm still confused about the flags in my makefile.
-c. -o. -Wall. -g. -std=c++0x.
Can any one tell me what all these common flags do?
Only the last flag (compiler command option) is very compiler-specific. The first three or four have been de facto standard since, well, the early or mid 1980s, I think. Of course there’s no guarantee that any particular compiler will understand them, but they’re not uncommon.
Note: while Visual C++ accepts the - flag prefix notation, it is usually used with / as flag prefix, since that’s the common convention in Windows.
-c
Compile only, don't link.
-o
Specifies an output file, e.g. executable. Unfortunately deprecated
for Visual C++ compiler. With Visual C++ use e.g. /Fe.
-Wall
With g++ all practical warnings. With Visual C++ all warnings including all sillywarnings, and that's a bunch!
-g
Generate debug information. Supported by many compilers but not Visual C++.
Then,
-std=c++0x
is a g++ compiler-specific option that specifies sort of C++11 standard. As I recall the difference from -std=c++11, for newer compiler versions that accept both, is that the former still permits some g++-specific language extensions.
Those are not "c++ flags", those are flags for a compiler, presumably it's g++ from the gcc suite.
All those flags are documented on both the online and the offline docs, the offline docs are probably easier to browse for a beginner due to the fact that you can just open the pdf in a viewer and use the search engine to search for a word.
This are the manuals for gcc.

What is the most complete and reliable open source C++11 IDE for Windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I don't intend this to be an opinion question and I am deliberately avoiding the word "best" for that reason. To frame my question differently;
Is there a fully C++11 compatible Open Source and free (as in free speech, beer and lunch, not as in Express, Lite, Demo, etc.) IDE that provides stable syntax and error highlighting a la IntelliSense, that works out of the box with C++11, or at least with a minimal, easy to follow amount of work?
I am asking this question because I really like the VS2012 environment but have become frustrated with the lackluster degree of C++11 compatibility, and my license is due to expire anyway.
Have you tried the "Visual C++ Compiler November 2012 CTP" update? It adds support for several features (most notably variadic templates) to VC11. The library is not there, and this compiler update is not considered production-ready, but I've found it to be great for working on my projects and using C++11 code till the final product comes out.
Also, I have used Qt Creator (quite independent from the Qt toolkit) for GCC-based C++11 development and it's a great IDE.
First: it's not (mainly) the IDE that needs the C++11 Support, but the compiler. That being said - here are some options:
it is possible to integrate clang into VS2012 (check here: https://github.com/ishani/ClangVSx)
You can use any IDE that supports MINGW as compiler (Windows-GCC-Port) e.g. Eclipse CDT, QT Creator, Code::Blocks, DevCpp
You can use any IDE that supports Clang as compiler (e.g. Code::Blocks)
According to http://www.codelite.org/LiteEditor/ClangIntegration, you can configure codelite to use Clang for code completion vs. gcc. So depending on the IDE, the compiler might provide things like code completion.

Compiling C++ programs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Should I use Visual C++ Express to write and compile or should I write in Notepad++ and compile it? I like using Notepad++ because of its clean interface and speedy start-up as compared to Visual which is a considerably heavier program.
If I do write in Notepad++ how do I compile it using Visual?
Can just compile via the command-line.
Visual Studio has intellisense, which makes coding a LOT easier. I mean, there's really no comparison.
For successful developing in C++, you need much more than just compiling:
linking
"solution" management(to a project usually belongs more than 1 file)
resource management (for icons, bmp menu etc..)
debugging
easy jumping into functions/classes
intellisense (autocompletion for method/classes)
You will make more errors, produce worse code and will learn slower, if you use a simple texteditor.
Do yourself a favor and start with visual studio (or any other IDE).
Later you can easily switch back to the basics (I doubt you will do that).
While it is possible to do all your work from the command line, it is easier to use Visual Studio's UI. It provide intellisense, easy configuration, integrated source debugging, searching, etc. Unless you are already an expert, I wouldn't recommend it.
If you are and you really want to use Notepad++, I would suggest using the Windows Platform SDK for a build environment (compiler + linker), and WinDbg for your debugger.
You can open up visual studio command prompt and run the command 'cl filename.c' to compile your program. However, this will help you only compile your program. If you want to debug it, you will have to open up a project under Visual Studio.
Notepad++ has less sophisticated tools management than some other text editors. For freely available alternatives, consider PSPad or ConTEXT. For paid alternatives, UltraEdit and EditPad Pro are nice.
All of them allow you to easily configure multiple external tools for compiling, building, etc.
If you really want to you can use both: you can let any solution item open in Npp: select 'Open With', then select to open the file with Npp and set this as default. This way, you'd use Npp for your editing needs, and still let VS manage the compiling/linking/.. No command line fiddling required.
That said, I use Npp as well, but apart from it's speed it's capabilities are nowhere near what VS offers, nor it's as customizable, and you can easily have VS look as clean as Npp.