Compiling C++ programs [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 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.

Related

C++ debuggers for linux similar to MS Visual Studio's debugger? [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 7 years ago.
Improve this question
A little background: for a while I've been using a free IDE for my C++ projects named CodeBlocks. Recently I've got a licence for Microsoft Visual Studio 2013 and I've got to say it's a completely different experience. The auto-complete is better, sensitive and accurate error checking as you're typing, a visual resource manager for MFC applications. And while these things you can get in pretty much any text editor with the right plugins, what I found especially appealing about MS Visual Studio is its very nice and visually appealing debugger (way easier to use and provides more information than the one in CodeBlocks).
I've been thinking for a while to switch over to a linux-based system since, to me at least, it seems to provide better tools for general purpose programming. However, I just can't bring myself to losing the MS VS debugger and going back to something like the one in CodeBlocks. I've been searching for various debuggers for linux but I can't really find one similar to the one in MSVS2013. Can anybody help me with this? What is a good debugger that I can use?
Functionality that I'm looking for:
an "Auto" watch tab/window which tracks variables that have been used recently or that are likely to be used, including a "this" pointer when inside class methods;
a "Locals" watch tab/window which tracks strictly local variables (without having to input them manually)
highlighting of variables that have changed when stepping from one instruction to another
being able to set multiple Watch windows/tabs and easily switch between them
being able to expand objects being watched in order to see their members' values
being able to easily see the values stored at addresses which watched pointers are pointing to
Well, you aren't short of options.
The classic Linux debugger - gdb - has a command-line gui based on ncurses which is activated by launching with the -tui argument. Admittedly it's a little bit basic compared to IDE integration, but it's incredibly powerful.
A stand-alone GUI for gdb called ddd is popular in certain circles. The interface isn't particularly modern, but it supports the full range of gdb capabilities.
If you're looking for an integrated development environment, then Jetbrains CLion is a relative newcomer but features reasonable gdb integration. If you're looking for a free alternative then Eclipse CDT is fairly well integrated.
My personal favourite option is a commercial plugin called VisualGDB which integrates VisualStudio with GDB, allowing you to compile and debug without leaving VisualStudio. It's quite flexible, and is actively supported and developed.
I used and loved DDD debugger (a GUI on top of the standard gdb) which felt very native and easy-to-learn coming from many years of MS VisualStudio environment.
You can do all those "standard" debugging tasks like drilling down into data structures with a mouse, setting breakpoints, inspecting variables, etc.
It is called Data Display Debugger and you can find more info on it at the GNU website which also includes screenshots so you can quickly judge if this tool is right for you:
http://www.gnu.org/software/ddd/
2017 edit:
The new MS Visual Studio 2017 (all editions, including the free one) now has a built-in Linux support which includes debugging Linux programs remotely with the MS VC's built-in debugger. That even includes the edit-and-continue support(!)
Here's a video that demonstrates this
You might use the GNU emacs editor to type -and even compile- your C++ code.
It can run the gdb debugger, the GCC compiler (for your C++ code you could invoke it as g++ -Wall -Wextra -g to get warnings and debug information), the GNU make build automation tool, the git version control tool, etc etc...
If you need a graphical interface for gdb outside of emacs consider xgdb or ddd.

suggestion for good IDE for C/C++ with debugging features [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
I am currently using Eclipse for C/C++ programming. Though i am accustomed to using eclipse for Java, i cannot figure out a good workflow for using Eclipse for C/C++
What i find lacking is a good debugging support. STL structures (vector, map) are not displayed in debug view as they are equivalently displayed in Java. They are displayed in a very obscure manner which is hard to interpret.
Upon googling i found
Better variable exploring when debugging C++ code with Eclipse/CDT
but i find the method not robust. It cannot display STL structures with objects (strings too) in them. Extending the .gdbinit file to support those will be an entire new project for me (as i am a new programmer)
Is there some other IDE good for C/C++ programming and debugging. Or is there something i am missing because certainly for such a industry standard language there must be some good
support out there.
EDIT: I am on a Win or *nix
I use visual studio express on Windows. It is free with alot of debugging functions.
1. Microsoft Visual Studio Express C/C++ (Best for Windows)
2. Code Blocks (Best of *nix)
3. Eclipse for C/C++
4. Netbeans
Hope this helps
On Linux I would prefer to use Code::Blocks
You can also look for NetBeans
GNU DEBUGGER
The C and C++ editor is well integrated with the multi-session GNU gdb
debugger. You can set variable, exception, system call, line, and
function breakpoints and view them in the Breakpoints window. Inspect
the call stack and local variables, create watches, and view threads.
You can evaluate a selected expression by moving the cursor over it
and viewing the tooltip. The Disassembler window displays the assembly
instructions for the current source file.
If your on a mac xcode is pretty good.
Embarcadero C++ Builder, also available as part of RAD Studio, is quite good, and has been undergoing significant development over the past couple of years.
It can be used to develop Win32 apps, Win64 apps, Mac OS X apps, as well as iOS and Android apps (the mobile OS's are only in the RAD Studio in the Delphi language for now, but C++ support is expected by the end of the year)
It has excellent debugging support as well. The IDE runs only on Windows, but does work quite well in a Virtual Machine running Windows inside a Mac, with either VMWare or Parallels. It does require a Mac, running Xcode, to compile Mac OS X or iOS applications -- that can be a separate computer, or the "Mother Ship" if you are running Windows in a Virtual Machine on the Mac.

C++/Assembly IDE on Linux [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
What I'm looking for is an IDE that will run on Linux, that has support for C++ and x86 assembly syntax highlighting. I've already tried Code::Blocks, but that won't let me run the program as I need to, so that didn't work well.
My needs:
Able to compile programs by issuing a "make all" in a certain directory
Able to run programs by issuing a custom command instead of running a certain executable
Graphical (not vim/emacs/etc) and will run in GNOME/Fedora 14
What would be very helpful:
Git integration
Autoversioning (like Code::Blocks does)
Eclipse doesn't work for me, as it no matter what I set it tries to do an auto-build/error check of the entire program, using the wrong toolchain, and errors out everything, even if I disable CDT.
Assembly syntax highlighting is not a requirement but would be useful. It does, however, have to have C++ syntax highlighting.
EDIT: By "Graphical" I mean that I already tried vim/emacs some time ago, and found them too challenging to learn how to use in a short amount of time without loosing my sanity.
EDIT 2: The given editor should also store project files in just one file, as I don't want to have to "git add" a whole new directory each time the editor silently adds some file there.
What do you think about KDevelop?
Vim
Be sure to look at
C++ Omni Completion
ctags and TagList
I use ctags --exclude=packagedir -R --c++-kinds=+p --fields=+iaS --extra=+q .
cscope (here and here)
Simply the best editor and will work anywhere - including in your remote terminal under screen :)
Eclipse CDT
Eclipse can import existing makefile projects and will not clobber the makefile :)
Eclipses intellisense is nice
I use Eclipse HELIOS on linux. It supports
profiling,
memchecking with valgrind
GDB debugging, remote debugging
call graph visualization, comprehensive symbol XRef (the usual eclipse shortcuts apply), simple refactorings
coverage GCov
oprofile
...
It should be portable so I expect most of this to work on windows.
If you are willing to go the commercial route there is SlickEdit, which works on multiple platforms and with multiple languages (including the two you have mentioned).
http://www.slickedit.com/products/slickedit/
Today, the best IDE for assembler on LINUX is SASM. Official site of SASM
I think emacs is the best multi-language editor.

What is the good cross platform C++ IDE? [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
It needs to have good code completion support, debugger, and a nice way to browse code (click to go to documentation).
Since I got spoiled by Java IDEs (Eclipse), it would be cool if it supported refactoring, reference search and some form of on the fly compilation, but maybe I'm asking too much.
So far I tried Eclipse C++ plugin, Qt Creator and Code Blocks. Eclipse plugin feels sluggish, Code Blocks has much worse completion then Qt Creator and Qt Creator is great for Qt stuff, but kinda hard to use for free form projects.
What are other options and first hand experience with them, since trying something for few hours and using something on a daily basis are two different things?
I have been using Code Lite for some time now. It provides support for auto completion. It has a code explorer and outline, though I find myself using "find resource" to open files. It has a plugin for UnitTest++ and some primitive refactoring capabilities.
link text
I'm very happy with Eclipse. It's not fast, but if you get a good enough workstation, it runs just fine, and considering how much your time is worth, a good workstation is actually pretty cheap. It also has a feature list a mile long (good features, not just bullet points), which I tried to summarize in this answer. It's also being actively developed; CDT 5.0 is a huge improvement over 4.0, and the next version (due out this month) adds even more nifty features (like syntax highlighting that can distinguish between overloaded and non-overloaded operators).
With some tweaking, you can turn VIM into a very good IDE. You can enable tabs for multiple source files in a single buffer, code navigation, and even auto-completion. The example below is for python, but the ideas apply to C++ as well.
http://arstechnica.com/open-source/guides/2009/05/vim-made-easy-how-to-get-your-favorite-ide-features-in-vim.ars
Use EMACS. M + / gives you all possible completion from the opened buffers. It has got nice integration with GDB as well.
I use plan9port's Acme. It only does a few things itself, but provides a very good interface to let any command-line program process any text from any of the tiled windows. So, instead of building all functionality into the editor (eg Emacs), it outsources just about all of it to command-line programs---actually more numerous and written in languages better suited to the tasks at hand than the editor's language (even Lisp).
http://www.faqs.org/docs/artu/ch13s02.html is "A Tale of Five Editors" (read Wily as Acme), from The Art of Unix Programming by Eric S. Raymond.
QTCreator rawks and has a great set of libs that are also cross platform.
recently I did some research for a good C++ Crossplatform IDE:
* Eclipse Galileo with CDT Plugin
* NetBeans 6.7 (which is also the base for the SunStudio IDE)
* CodeBlocks 8.02
* CodeLite 2.x
After all I have decided to use CodeLite 2.x.
Please see this permalink for a Summary: ide discussion
I'm a fan of 'Code::Blocks'
Code::Blocks is a free C++ IDE built to meet the most demanding needs of
its users. It is designed to be very
extensible and fully configurable.
Finally, an IDE with all the features
you need, having a consistent look,
feel and operation across platforms. - (the site)
Their latest release has been amazing... For a while it was difficult to get it since they only had the RC on their main site. Now that it's been released proper (not just dev snapshots), its much easier to get.
built in Astyle, code completion, and multi-compiler support, all cross platform w/ wxwidgets.
Anjuta might have Windows port:
http://en.wikipedia.org/wiki/Anjuta
You can use the Ultimate++ framework It is a C++ cross platform framework with a great IDE you can develop visual UI applications
please visit http://www.ultimatepp.org
SlickEdit is quite good and available for most platforms.
I've recently discovered NetBeans for C++. In the past C++ support in NetBeans has been lacking, but the 6.5 version has improved greatly. If you setup your project following guidelines on the NetBeans site, then code completion and debugging work well in Linux with g++ & gdb. I've not tried using NetBeans for C++ on Windows, but I don't think there would be an issue using DevC++, Ming or cygwin with g++ for compilation.
NEdit along with this package:
http://code.google.com/p/nedit-macro-kit/
It's cross platform, cross language and customization-friendly.
I'm currently giving Geany a try on gnu/linux, and so far I'm loving it! :]
I would otherwise be using Netbeans for C++, but there seems to be a few nasty bugs with their most recent release. Geany gets the job done, at least for now.

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.