Visual Studio 2015 automatically include missing includes [closed] - c++

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
I wanted to ask if anyone of you knows if there is a setting or plugin for Visual Studio 2015 Enterprise to automatically include any missing things, example if a namespace is missing or if "endl" is missing it includes the class.
Thanks!

I'm afraid not only can I not find / am not aware of such a plugin - I doubt it will ever exist.
The problem comes that without knowing every include file on your computer (which is a very time consuming/hard process), how could said plugin know which one you wanted?
Example:
I have marmalade (A cross platform development tool), Cygwin-Dev (A windows unix-shell), a GCC-cross compiler and visual-studio installed.
This means my computer has four (if not more) versions of "iostream", as well as several different implementations of the standard library (for different platforms).
How could such an add in know "which" include I wanted?
Personal opinion:
I understand what you are looking for, but honestly - even if such a tool did exist, I would advise against using it. when you get beyond simple example "hello world" programs and alike, C++ include files become a non-trivial subject. A single project I am involved in professionally has near two-thousand header-files, ranging from Iostream, though to third-party libraries, and near a thousand home-grown files.
Managing and understanding what to include and where is an essential skill of the C++ programmer, and quickly becomes second nature.
P.S.
Remember that every function on sites such as en.cppreference.com/w/ will state at the top of the page what header file you need to include them. Reading such reference pages will (also) become second nature in due time.

Related

Simple Intellisense Solution [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 5 years ago.
Improve this question
I'm working on a project in C++ with and the ROS Catkin compiler system (Ubuntu). Its my first real project with ROS and I would to keep the setup simple (as the code itself will be hard enough).
Preferably I would like to just use Sublime to edit the code, but it has no c++ intellisense (already found a linter and formater plugin). I also tried Eclipse, but there the intellisense seems to not work unless I set up a whole project.
Does anyone know a simple setup for c++ intellisense on Ubuntu (using Sublime/Eclipse or something else)?
I'd really love to have it as it allows to naturally explore new libraries without the need to open the documentation for. ever. new. class.
This is the plugin I use for atom text:
https://atom.io/packages/autocomplete-clang
I believe it exists for sublime as well:
https://packagecontrol.io/packages/ClangAutoComplete
Eclipse has a C++ IDE version, so use that if you want to use eclipse:
http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/keplersr2
And also, if you don't mind IDEs you should check out QTCreator and Kdevel, the first I've noticed to be one of the most used IDEs for people that don't just use vim or emacs. Kdevel I've used a bit and it has some interesting features, though some things might be lacking. In both cases there are some speed problems with autocompletion (wait times of 100-500ms) and code highlighting (sometimes it breaks a bit and highlights the wrong line or doesn't highlight at all, but that's very rare)
Another alternative that people might mention is CLion, which is from Jetbrains, but its closed-source, not well supported and whilst it might look nicer than QTcreator it has more or less the same features but is much more resource-heavy and laggy, so I'd pass on that.
Also, most of the "old guard" seem to swear by vim and/or emcas and if you have a lot of time on your hands you could check out a guide for setting up one of those as a C++ text editor, they both have very mature plugin systems and whilst they might be harder to get into they might also give you more freedom and more interesting plugins.

google test/mock vs boost vs catch support for c++14/c++17 [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 5 years ago.
The community reviewed whether to reopen this question 29 days ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am evaluating which testing framework would be ideal for me.
The choice is among these three: google test, boost.test and catch.
I would like something robust that has not so many dependencies and that is able to support C++14/C++17 if needed.
Another question, do you know which framework big companies in the avionics/space fields use?
I would like something robust that has not so many dependencies and that is able to support c++14/c++17 if needed.
Google C++ test framework requirements mention:
A C++98-standard-compliant compiler
It works just fine with C++14, I personally use it. From the linked documentation you can see that it has no dependencies on external libraries (see section requirements).
Catch known limitations mention:
our desire to support C++98 compilers
It works just fine with C++14, I personally used it in a couple of projects at work. Catch is a header only library, it has no dependencies at all.
Boost C++ libraries usually perform compile-time detection of compiler support for the standards and features are enabled/disabled depending on the result.
As a rule of thumb, those libraries usually depend on some other libraries picked up from Boost itself.
do you know which framework big companies in the avionics/space fields use?
Often they require not only to write tests but also to have a code coverage estimation. There are a plenty of professional tools for that, few of them are for free and (at least, as long as I know) there doesn't exist a standard de facto for that.

Auto-Include needed C++ headers IDE? [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
I'm a Java Eclipse user as well as a Qt Creator IDE user.
In Eclipse IDE for Java, when I type this line for example :
Vector<int> v = new Vector<int>();
it automatically generate this line at the top of the code :
import java.util.Vector;
Question :
Is there a C++ IDE or a plug-in for the Qt IDE that generates for example this line :
#include <vector>
after I type :
vector<int> v;
I'm using NetBeans IDE, which can handle C/C++, PHP, Java, ....
It has autocomplete for writing functions / included headers etc.
Allso it can sometimes automatically add appropriate headers, if I use autocomplete when writing a function name, but still, it's better to define needed header files manually. ;)
What you can do to automate this is going to vary by IDE. However, what you can do universally is Google search for say, std::vector and practically any result is going to include the name of the header you need.
Of course, in these days of precompiled headers, it's not unheard of to blanket #include a wide-range of common STL stuff even if your project doesn't currently use it.
On a related note: for your example, auto-addition is potentially ambiguous since you didn't specify the std namespace.
Most C++ IDEs don't provide this (though I believe VisualAssist for Visual Studio does). As people have said, C++ is not the nicest language to parse which makes this a little more challenging.
Typically C++ folks just know what headers they need to include :)

tools to allow C++ development, with out separate .h .cpp files [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 6 years ago.
Improve this question
I am developing some c++ code, but having code separated in to .h and .cpp is driving me mad, as it is slowing down re-factoring.
Is there a tool that lets one work on a single file. An editor that just hides the truth, or a per-processor that takes a single file and produces the two files .cpp and .h
clarification:
I want a single file per compilation unit (like Java, C♯, Eiffel). I will still have to have #include in files to include the headers of other modules. (but then Java and c♯ have import and using).
clarification 2:
Things are easier if everything that should be together is together.
i.e. one and only one file per class.
There's Lzz. I haven't tried it, but it seems like what you're looking for.
Whatever tool you try to use to do this will only hide some of the complexity or make your code C++-unlike and that will in turn make it harder for others to read/maintain.
I recommend that you just learn and get used to the compilation model of the language rather than fighting it. Deciding what goes into the header and/or the implementation is not an automated process, but rather part of the design and tools cannot design for you. Any automated tool to do that will end up generating a less than perfect result, probably longer compile times and/or leaking implementation details to the users of your headers.

Looking for a C++ database library that works with Visual Studio 2008/2010 [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 8 years ago.
Improve this question
I'm looking for a C++ libraries that can work with Visual Studio 2008/2010, but not MS-SQL. Since MySql is the first database application that I used, it would be much helpful if it also can work with MySql. I had a bad experience with setting up MySqlConnector in Visual Studio. It was such a nightmare, it was so difficult to set up the environment. The reason that I like Visual Studio because of Visual Assist and ViEmu. I feel very unproductive without these two tools. So my priority will follow this order:
Update
0. Cross platform, not specific to Windows. ( I only like Visual Studio not MS )
1. Easy to set up with Visual Studio.
2. Has similar design to STL C++. I'm a fan of STL C++.
3. Light weight since I'm still a student, and I only want to experiment.
Thanks,
Chan
I think SQLite might be a good choice, it's massively supported with ADO.NET.
Read this post, it might give you few aspects on data access from C++.
Update
Read this post to have more on SQLite~C/C++ (no MS).
BTW, many big companies use SQLite.
I am not sure if it stays in the same criteria with MySql.
If MySQL is what you are familiar with, then perhaps you should use MySQL++. The FAQ section discusses using it on VC++.
It seems to fit all your requirements except possibly "Easy to set up with Visual Studio" since that is entirely subjective, but download the code - compile the code - link the code seems fairly straightforward to me.
MySQL's native client has a C API (and therefore easily usable from C++)