Visual Studio 2017 Unit Test Automatic Setup - c++

Adding a Native Unit Test project to a 2017 Visual Studio Solution, VS2017 Wizard does not add the Unit Test functionality automatically in the project settings ie D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\VS\UnitTest for Include & Library directories, the path of the Project to be tested, etc.
Also, including the functions I want to test in the TestUnit project ie Component1 fails once again but this time in the linking phase, saying that it could not find the Component1 object or library.
So, currently, I have to add all this stuff manually, ie Adding the UnitTest path inside the VC++ Include/Library Directories of the Configuration Properties of the project, adding Obj Dependencies in the Linker's Input etc. That's ok but the question is Can I fix this to work automatically as I used before?
PS: This was not always the case. Before I add/uninstall some features using the VS installer, it worked just fine.

Related

make visual studio add all necessary when building release

So I am working on an example project that displays video from a network stream.
The project is in C++.
After building the project in release, and trying to run the project on a different computer, I get errors on missing DLL files.
These DLL files are located within the installation location of Visual studio.
one example is msvcp140d.dll.
After copying all the missing files, I get a generic error with no specific file.
So:
Is there a way to tell visual studio to add all relevant files when building the project?

(Visual Studio) How can I use googletest libs and headers from outside my solution?

I'm using the built-in Google Test Adapter to write unit tests for a project in Visual Studio 2017. When I create the unit test project in my solution VS creates a package directory with the libs and header files for googletest, along with a package.config file. However I'd like to keep the googletest files out of my solution directory (and source control, though obviously I could just ignore them), and in a shared directory like the windows or standard library headers.
How can I configure my solution to get the libs and header files from a shared directory outside of my solution?
Not quite the answer I was looking for, but I learned that Visual Studio can automatically download NuGet packages when they are missing from solutions. Therefor you can just ignore the package directory from your source control but include packages.config, and whenever you clone the project Visual Studio will download the missing packages. This was good enough for my needs.

Visual Studio 2012 Native Unit testing - Linker problems

I'm trying to create a unit tests for C/C++ with the Microsoft Unit Testing Framework for C++. I'm using visual studio 2012 with SP2. I want to test a project which is compiled as dynamic library, and whose classes are declspec-exported. This project is dependent on a few additional libraries which are outside the solution.
I did the following
created a new test project add->new item> test-> C++ unit test class
added a reference to the tested project under properties->common Properties->Framework and reference. The same could be done to the additional libraries, as they're not under the same solution.
under properties->C/C++/additional include directories, added the paths the headers of tested library and dependent libraries
under properties/Linker/Additional dependencies, added the *.lib names
under properties/Linker/Additional library directories, added the paths to the libraries
Still, any usage of the additional libraries in the test project causes "unresolved external".
Can anyone help?

Using Separate Libs for Debug and Release in VC++

I'm downloading GLFW for use with Visual Studio 2010. I see that the download has a separate folder for Debug and Release builds (each folder has two Libs and one DLL), but the filenames in both folders are the same. How should I configure Visual Studio to pick the right file, since I would expect that renaming a Lib or DLL would interfere. My research has been relatively unfruitful, and I think it may have to do with ifdef commands or something. Thanks in advance.
Visual Studio build properties (including the directories where it searches for files) are all build configuration specific. On the project configuration dialog, just press the drop-down to switch from Debug to Release. The settings you change will affect that particular build configuration and no others.
If you don't have this dropdown, then you're using the non-advanced interface, which no human being should ever use. Switch to the advanced interface.

How to make a single static library from multiple static libraries?

We recently converted a C++ project from Visual Studio 6 to Visual Studio 8. Everything went well until we reached the compilation of a project who put all the static libraries inside one big static library. By default after the conversion between the two version of projects the project didn't do anything (no big static library was created, it only said that the project was up-to-date).
We found a working solution by adding a dummy (empty) file to the project (it had no other files before, in the Visual Studio 6 solution). Everything went well and we managed to compile the project with the new development environment (Visual Studio 8).
My question is: Is there any other way to do this, without dummy files added to the project?
Thanks in advance for your responses
You can use the method described in the answer by nobugz also with multiple configurations and different directories for debug and release input libs. Just add all input libs, debug and release, and use "exclude from build". In the debug configuration exclude all release input libs from the build, in the release configuration exclude all debug input libs.