clang-based cross-platform C++ IDE? - c++

The clang C++ compiler claims to be built for, among other things, better IDE integration by providing an API for the IDE to use for tasks such as parsing the code.
So, are there are any good C++ IDE's that use clang to provide features such as semantic highlighting, refactoring, and finding and showing semantic errors in real-time?
I've been using Eclipse CDT, but its C++ parser is full of imperfections that cause the IDE to report a lot of annoying false positive errors in the code. I would like to have an IDE that reports an error if and only if the compiler would report the same error, hence my interest in an IDE that's built on a compiler's internals.
I'm primarily interested in cross-platform IDE's, although I wouldn't mind knowing about single-platform ones for Windows or Linux (so not Xcode), as long as they are FOSS (another reason why not Xcode).

Qt Creator is basing their next-gen code parsing and associated functionality on Clang:
https://www.qt.io/blog/2011/10/19/qt-creator-and-clang
Looks very, very promising!

have you tried clang complete?
if you're punk rock, then vim is enough ide ;)
i often work with xcode so... can't really share firsthand experience, but i knew of its existence.

gedit isn't really an IDE, but there is a plugin for it that provides code assistance using clang

It seems that CodeLite v3.5 starts supports Clang natively. However I haven't found is it possible to setup LLVM as backend.

A relevant new development in this area in the Language Server Protocol (LSP) project, which aims to be a language-agnostic API that allows editors / IDEs to be decoupled from backends that provide code intelligence / analysis.
There is ongoing work to create a clang-based C++ backend called Clangd.
There is also ongoing work on several editors / IDEs to support the LSP as a client.
Once the backend implementation matures, all editors supporting the LSP will, in principle, be able to leverage clang's capabilities as exposed through Clangd.

KDevelop now has clang based c and c++ support, including semantic analysis and autocomplete. It is primarily for linux but (as of October 2016) has a beta release out for windows and mac as well.
For emacs there are irony-mode and rtags that provide features such as auto-complete, on fly error checking and jump to symbol. When combined with cmake-ide they are very powerful tools and one well versed in emacs can be highly productive in this environment.

Not FOSS, but JetBrains (of IDEA and ReSharper fame) are building out their AppCode product into a full C++ IDE supporting Win/Linux/Mac and using clang.
Yes, really.

jucipp
~900 stars on GitHub in 2019Q2: https://github.com/cppit/jucipp
Now moved to GitLab: https://gitlab.com/cppit/jucipp
Clearly advertises libclang backend as a main feature.

Related

Most compatible C++ Doxygen comments for IDE's

I've been working on some C++ code that some of the other developers I work with will use. A lot of the developers here are MS based (they use Visual Studio as their main IDE) we also have a lot of developers who use other IDE's as well for different projects (like Eclipse and Qt, even some C++ Mac development with XCode).
The code I have are generic library functions that are cross platform compatible, so it will be used by different developers on different platforms/IDE's. Which brings me to my question: is there a compatible Doxygen comment 'style' that can be 'understood' and used with the code completion ability by most popular IDE's (VS, Eclipse, Qt, Netbeans, XCode)?
Something like VS's IntelliSence where when you use your scope resultion a description pops up for that item.
If there is not a 'compatible' way, are there any plugins that can be used for all IDE's that would allow for this ability, or would I have to write my own? Googling has lead me to many dead ends (possibly because I may not be inputing my question into correct search terms), and writing my own plugins is an option, though I'd prefer a 'compatible' style or existing plugin if possible to save time.
Thanks in advance!
Edit 1: I should mention that I am requesting Doxygen style commenting becuase it is the documenting tool we use to build out some of our documentation thus all comments in any code we make must be Doxygen style (not sure why this issue never came up before here, haha)
So I have been struggling with this question for awhile now. In the past I have used several different software suites for development, with each having its own quirks in regards to using the documentation to drive some of the more fancy features. After working on a project in C# (and Visual Studio 2010) I have come to realize that the XML commenting seems to work the best for me.
I personally believe that this is a failure in most of the IDE applications themselves, for example, it seems that Visual Studio really only supports XML commenting for C# applications to feed features such as Intellisense, and the less fancy syntax highlighting. I have found that there is a commercial plugin available to "enable" this feature in Visual Studio, but why should I pay for something that just has not been enabled?
But I have diverged from your original question. When I was first researching this it seemed that Apple themselves must use Doxygen as they seem to use this standard for highlighting code already. With that said, here are some other resources to get the same functionality in other applications:
Atomineer Pro Documentation seems to be the tool for the job in regards to Visual Studio although I have not personally used it. It seems relatively simple to use.
Eclox seems to be a front-end plugin for Eclipse that actually uses Doxygen. But from what I remember you should be able to tweak the IDE itself in the C++ settings in regards to syntax highlighting.
Doxymacs maintains a symbol table inside of Emacs for some quick searching abilities.
It seems that on the Vim project page there's a script that handles this for that editor as well, it is called DoxygenToolkit.
I absolutely feel your pain. There's something warm and toasty about having a nightly crontab generate cleanly documented markup that is easily searchable. I have only recently been on a warpath for finding the best mechanism available for achieving this cross-platform. From what I've gathered most development environments support extensions of sorts, and since Doxygen is basically the "gold standard" there's usually one way or another to shoehorn support in if it doesn't exist out of the box.
If you're interested Doxygen actually supports the C# XML comments out of the box, but unfortunately I wasn't able to get it working in Xcode, and I'm not well versed enough in AppleScript to hack it together. But by all means please update if you do!

What's the best way to program c++ on a Mac?

What is the best software ( open source ) for programming on c++ a Mac ?
any suggestions?
Xcode, same as C and ObjC.
You don't need anything special to program C++ on the Mac. The only real requirement is to install the developer tools from Apple. This provides the compiler tool-chain and development headers needed to write and compile standards compliant C++ on OS X which is really all you need.
Once you have done that it's a case of either using Xcode to manage your projects and compile your source, or outsourcing to an external build system and possibly an external editor.
A lot of people are happy just to use the default tools. Personally speaking I favour textmate as an editor and I use Waf as a build system so that I can compile my code on many platforms and am not tied into to OS X per-se.
Eclipse works reasonably well on Mac. The requirement that your IDE be open-source is a little odd. More important that it works well, right?
Textmate is the best option that I've tried so far. I, personally, found Xcode rather annoying to use, and Textmate was perfect for my use. The only potential issue is that you have to pay for it (after a 30 day trial).
You can download it at: http://macromates.com/.

Which IDE for C++ software can I use for targeting Windows, Linux and OSX?

I was reading today question on IDEs fo C++, and there are very good ones like Netbeans.
My question is about creating a software in C++ on Windows Environment, but let users install and run my software also on Linux and OSX.
Does netbeans has a compiler to do the job, or is there any good IDE which has a compiler for targeting my c++ code to these other environments?
thank you
QtCreator. It's awesome, slick and everything.
While it is not as feature rich as some competitors, it does many things just right that others don't.
I would say it is the one truly cross-platform IDE that is competitive to single-platform solutions. And it comes with tight integration of a very powerful and clean cross-platform toolkit. Something that you need for most cross-platform applications by itself.
I use Eclipse CDT and have had some degree of success. But I'm a Java programmer, so it's what I'm used to. It's worth checking out, and the extensions are quite cool.
Many people like Code::Blocks and it is cross-platform, with integrated debugging, code completion, etc. Qt Creator is also good and at least still very minimalistic.
Without a doubt VisualStudio with gnu make.
I've found Visual Studio to have the best IDE for C++. In addition, it's debugger and the way it handles multi-threaded applications is excellent.
And you can tweak the properties for your project to use different compilers and compiler flags of your choice, so it can build to any target.
You're talking about cross-compiling as GMan said, that's a compiler job, not IDE's and itu's kind of hard to make C++ software that runs well on Linux/Windows/MacOSX, C++ isn't a cross plataform language beacuse of its ABI, so you should try to use C++ standart code.
If you're making a consloe application there's no much problem just be care not to use system interface, but if you're planning to do some kind of graphics app then C++ it not the better choice for your purpose. Try some design that split the view from the controller/model of the app.
You can use QtCreator or NetBeans. First on C++ secord on Java. Both use MinGW g++.
Just a thought: you don't need to use a single IDE for all platforms. It is very common, for example, to use Visual Studio on Windows and Xcode on Mac OS X for cross-platform projects. I'm not familiar with Linux IDEs thought so couldn't recommend anything there.
Write makefiles for each OS? Simple enough seems to me.
Concerning cross plattform development it doesn't make a difference which IDE you use. Just make sure you use a cross platform (and possibly IDE independent) build system like SCons or cmake.

Good C++ Debugging/IDE Environment for Linux?

I have a friend who is trying to make the switch to Linux, but is hung up on the apparent lack of debugging/IDE environments for C++, especially as they relate to template programming. He has been using visual studio for years and is maybe a little spoiled by their awesome IDE. Does anyone have any good suggestions for an environment where he can, under Linux, develop and debug with all of the usual things (Breakpoints, line highlighting for compilation errors, step in/over/out/etc, etc) that he's accustomed to? Thanks!
How about Eclipse + CDT ?
Although many people think of it as a Java IDE, he could try NetBeans. I've used it on Windows for C and C++ development without a problem, and I know NetBeans is supported on Linux, so it would be worth a shot.
It looks like most of the features he wants are included in the C/C++ development toolkit, including integration with GDB, a profiler, and more.
Visual Studio is good, indeed.
On the free side:
Qt Creator is getting quite good too, it's worth a try. There are advantageous by-products coming from the Qt framework:
huge library - not only to build GUI applications but for other domains as well
portability on multiple platforms
A version 1.3 beta is available as a preview of the upcoming release but the current 1.2.1 is already all you need to manage projects.
Eclipse has already been mentioned, it's a very good environment offering many plug-ins (Mylyn, SVN, ...).
MonoDevelop somewhat supports C++ (more and more, I didn't check the latest version).
I've used Eclipse for C/C++ and it's pretty useful. It's also used at ACM ICPC World Finals http://cm.baylor.edu/welcome.icpc
I'd recommand Code::Blocks (but use a nighty build). It can be coupled with gdb to enable step by step debugging and all that stuff.
Not exactly an IDE but SublimeText 2/3 is available on Linux now. There may be a debugger plugin for it too, who knows.
Edit
Here's a gdb plugin for SublimeText
I havn't explored it personally, but Emacs has a C++ development addon that looks very much like a full IDE.
About 7 years ago I used KDevelop that was shipped with KDE. I found it quite good back than, and I hope it also improved with the time. I found it quite comparable to VC++ 6 at this time.
It also contains Qt support, if you are in need for some GUI toolkit.
Depends, Code::Blocks is good, Eclipse is very nice too, but you will need a very good computer. In my opinion the best choice iss gcc, gdb and ViM or Gedit.
My buddies from work use Eclipse + Scons, they also use Valgrind(spelling?) for tracking memory leaks and such.
Many of the IDE features you listed were debugger features. The ddd (Data Display Debugger) debugger is quite a nice GUI wrapper for gdb, allowing graphical representation of data structures, a non-crappy source listing window (ie. unlike the l command of gdb where you don't get context), and also allows you to use any and all native gdb commands directly if desired.
Have a look at CodeLite. It's available for Ubuntu and Fedora out of the box and even for Windows and Mac. So you can have the same IDE on different platforms.
We tried Eclipse and NetBeans but left them due to their huge CPU and memory usage. We have a development server and all the developers connect to it via RDC. Thats why these IDEs miserably failed in our model.
So, we looked for some native IDE. Found CodeBlocks to be very good and super fast. We sort of settled on it but later found CodeLite and liked it better than CodeBlocks.
I just seeing this question after 12+ years. AnyHow I just writing my answer. I personally use Quincy IDE for C and C++ development. it is very lite weight and debugging watch list is very much good and easy to use. I'm just attaching the link to the site. try it.
But you have to install it with wine.
Quincy <-- Click here

Is is possible to develop for windows, in C++, without Visual Studio? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm aspiring to work in real-time 3D graphics. I work almost exclusively in C++, with a healthy smattering of win32. Realistically, do I have any sane alternatives?
You can use the MSVC compiler without the IDE. That's probably your best bet. It's a good compiler, and it is the de facto standard for Windows development.
There is definitely nothing wrong with ditching the IDE and simply using the compiler.
I believe the MSVC compiler can be used from the Code::Blocks IDE with no problems.
Alternatively, invoking the compiler from the command-line is a tried and true approach too.
Eclipse: http://www.eclipse.org/
Code::Blocks is pretty cool: http://www.codeblocks.org/
Depends...
Cygwin/Mingwin gives you a compiler. Qt or wxWidgets gives you a GUI toolkit that's easy to use and both are portable.
I agree with the question though. Visual Studio is a pig. Its debugger is pretty nice, but the rest is a pig to work with (particularly coming from a OSS background where the tools don't generally try to lock you in).
You could also look at nmake and calling the VC++ compiler tools directly from the command line.
We use VC++ as a compiler / linker but use Jam to drive the builds. The actual Visual Studio is only used as a debugger. The benefit is that once we set up Jam to build a project in Windows, it takes minimal effort (frequently none) to get it working for Unix.
The Zeus IDE works just fine as a MSVC alternative. It can even import MSVC project and solution files.
A bit late to the party, but I'd like to add that in 2018 there finally begins to show up a viable alternative that is good enough to promise emancipation from the monopoly of VS on Windows C++ development:
Sublime Text as editor, with the following plugins:
EasyClangComplete, a decent (like, just working) replacement for Intellisense;
[optionally] Clang Format, for much more flexible source formatting experience than MS would ever come up with;
Clang-cl as a wrapper around Clang compiler aimed for maximum MSVC compatibility.
Unfortunately, Microsoft Build Tools are still needed for standard library headers, but the download size is nothing compared to the whole VS behemoth. The upside is that Clang-cl picks them up automagically and Build Tools somehow don't mandate that you let their executables go online to sign in and activate your free license yet!
Setting this all up to a working configuration is a bit more complicated than slapping together a VS project/solution, but it's totally worth it. As a bonus, setting things up manually might give you a better understanding of what goes on under the hood of an IDE.
One thing to miss might be the superb VS debugger... Well, if you're ready to break habits, the open source x64dbg might come to the rescue, ability to view and step through source code via .pdb files included (and yes, Clang can generate them now!).
Update: As of 2019, a much better and future-proof alternative to EasyClangComplete is using Clangd via LSP plugin.
Absolutely, but it's just a lot easier to use Microsoft's IDE to develop for a Microsoft operating system. When in Rome...
Eclipse is a good alternative.
The Code::Blocks IDE comes with the MinGW C++ compiler and support for wxWidgits. The IDE is pretty minimalist which may or may not be what you are looking for - I really like it.
Dev-C++ I have found very useful, and free :)
Very possible, Qt is your friend. Qt Creator is in RC stage too so something to look forward to. Until then you can use it with something like Code::Blocks. Code::Blocks itself is a great environment alone, and also has a lot of support for wxWidgets. If you're just looking for an IDE change, as previously mentioned, Code::Blocks can use compilers from other IDE's as well.
-John
SlickEdit (or a number of other editors that support ctags or something similar) makes for a pretty decent 'IDE'.
You can use these editors with makefiles (or other build tools) to drive pretty much whatever compiler you want (MVCS, mingw, Comeau, Digital Mars, whatever).
A couple employers ago, that's exactly what we did. We used MS compilers driven by makefiles and the main editor used was SlickEdit. We used the Debugging Tools for Windows package for debugging (a lot of what we did was kernel-mode). Worked out pretty well.
Wascana Desktop Developer is a distribution of Eclipse CDT configured specifically for developing on Windows.
I would recommend giving Notepad++, MSBuild, and the Windows SDK a look over. You could also use XBuild, but that is more MONO specific. Mind you, MSBuild, and XBuild are just automation tools, so you'd be spending more time with Windows SDK.
I'm sure to receive a lot of flak for this, but I find C++Builder to be a much easier IDE/compiler to develop Windows C++ apps with than MSVC. It may not be the cheapest solution, or have all the same bells+whistles, or be the most language-compliant (its 32bit compiler does not support C++11 yet, but its 64bit compiler does), but you can't really beat its visual UI designer and 3rd party component market.