VS2010 C++ how to have different project references for each developer - visual-studio-2010

We are trying to move from C++ VS2005 to VS2010, but can't figure out how to move from the solution dependency model to the MSBuild project reference model. We have multiple developers, but don't distribute all the source to each developer although each developer is provided with all the header files, .lib, and .dll files.
With VS2005, each developer has their own solution and sets up a project dependency to a project, unique to that developer, which includes all the .lib files they don't have source for. This way, they can use the most current .vcproj files for the source they do have.
In trying to move to VS2010 / MSBuild, the project files now require that dependencies be included as references, yet some developers will not have a copy of the referenced project, only its .h and .lib.
Is there any way to combine the solution-based dependency model of VS2005/VS2008 with the MSBuild project reference model of VS2010?

MS removed implicit adding libraries in linker list once dependency added.
Now libs should be explicitly specified in Additional Dependencies of linker settings as well as includes in settings of compiler.

Related

How to link a static library in Visual C++ 2017?

Trying to set up libtins on windows. Im relatively new to Visual studio and most of the documentation on the matter was for older versions. I was able to get the include files set up with the project but linking the .lib's was problematic and i cant seem to configure it properly. The properties menu seems pretty convoluted as im used to doing most things compiler related configurations from a command line.
In the Solution Explorer, right click on the project, select Properties. Expand to Configuration Properties > Linker > Input. Add the .lib file to Additional Dependencies. Do this for both the Release and Debug configuration.
If the static library in question is in fact the output of another visual studio project, you can just add that project to your solution file, and then add a reference to that project, and let VS2017 figure out where the lib files are located, and that the linker needs them.
i.e.
Solution '...' (2 projects)
Lib Consuming Project
References(Lib Producing Project)
Lib Producing Project
hint for creating static libraries from visual studio
for Lib Producing Project, go to Properties
Properties->Configuration Properties->General
and set Configuration Type to static lib (for both debug and release)
for foreign static libs, the accepted answer is AFAIK the proper way to do it.

How to combine two dependent projects in Visual Studio

I have a solution which has two projects. One is a static link library project, and another is a console project for demo. Now I want to create a MFC project to replace the console project, what should I do to configure the MFC project.
the MFC project need to use some classes in the .lib project.
I have set MFC project as start project and depend on the .lib project.
My platform is win7 + vs2015.
Actually, the solution is EasyPR, you can get it here EasyPR.
Thanks for any help.
Setting the dependency to the static library is one step.
To compile the code you may need headers for the compiler. So the MFC projects may need settings for the compiler to define additional include paths.
You still need to configure the linker to use and find the library. To reference the library you may use a pragma comment lib. In the linker settings you may add an additional path for the libraries.
Or you may simply drag the lib into the solution explorer. The build mechanism will know how to treat a lib and will include it into the build process. The later will only work if you have 1 lib for release and debug.
If you have different libs for release and debug a advise you to use different names. You may adjust the project settings of the MFC program for debug and release differently.

Visual Studio 2015 C++ solution/project setup for interchangeable dependency use case

Since Visual Studio 2010 the option to specify C++ project dependencies in the solution is deprecated (What does the “Link Library Dependency” linker option actually do in Visual Studio 2010?).
However hard-linking a library dependency in the project file is not always convenient. I would like to keep the dependency interchangeable.
For example I have a project defining unittests for a set of libraries.
I want to execute the unittests for different versions of the library (each defined in its own vcxproj).
Pre-VS-2010 one solution file could be created for each library dependency, requiring only a single project file for the unittests.
Now the "preferred" way to do it would be to duplicate the unittest project files for each library dependency, which is undesired.
The .lib output of the dependency could be manually added to the "Additional Dependencies" in the linker options, but this feels like a hack.
What is the best practice for modeling these kind of dependencies in Visual Studio 2015?

VS2010 VC++ Setup Project misses language dll

I have created a Setup Project in VS2010 for my VC++ project and I have it generating a setup file and it includes Primary Output, Content Files, Documentation files and Resource Sattelite DLLs from my VC++ project. My VC++ project is multilanguage and hence includes language DLL files in subdirectories. My issue is that the Setup Project does not include these language DLLs (nor their directories into which they must be placed).
I would have thought that these DLLs were included in the Project Output but they are not. :-/
I know I could add them manually by referencing the files directly, but that means including a absolute reference which I would rather not do. Also, a fixed reference means Release/Debug versions of the file are not handled (only one of them is use regardless of project setting).
Suggestions?
Edit: I have now tried Setup Project, InstallShield LE and WiX. None of them include the localization dll's into the setup project (only managed a working setup with Setup Project, but could see that the other installers did not include the required dll). I can't even fint any reference to this being a know bug and I have really tried hard to find a solution to this.
Found it over there:
C# Creating a setup for multi-language
It worked. I hope it is what you were searching for.

Make Visual Studio not to compile any projects

Is it possible to tell VS not to recompile some projects every time and use already compiled dll-s instead?
You can exclude any project from building in Configuration manager. Just unselect desired projects in Build column. You still will be able to debug those projects.
Instead of project references, you can add the compiled DLLs as references.
Any such referenced project will not rebuild if not changed.
However, since the references will now be to DLLs, you need some strategy to keep them synchronized and up to date with your code.
As I understood your question, you have a solution with multiple projects and you seem to have dependency of some of them on some other.
VS will always compile all the "loaded" projects. But when you add a reference to a project, add it directly to a (preferred) DLL assembly file, and not to one of the projects. This way the other project will be compiled but you are referencing the same DLL assembly over and over. Since if you reference the project, the output of the project is always what you reference actually.

Resources