Separate property pages for Visual C++ 2010 / 2012 [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have both Visual Studio 2010 and 2012 installed on my PC. It turns out that when property page Microsoft.Cpp.Win32.user is changed in Visual Studio 2010 the same changes propagate to Visual Studio 2012. It work the other way around to - changes from VS 2012 propagate to VS 2010. This makes it difficult to use 3rd party libs when binaries for different version of VS are named the same, because both VS 2010 and 2012 would be searching the same folder for lib files.

Instead of changing the Microsoft.Cpp.Win32.user property page, you could (and imo should) create one or more project specific property pages, containing the thirdparty lib information. This has several implications:
pros:
It fixes your problem, since you can use different property pages for VS10 and VS11 projects
You can distribute your projects to other VS environments and other developers more easily, if the project specific property pages are located with the project and not in some general place.
Only the projects that need lib X use lib X, as compared to every project uses every thirdparty lib you have.
You can upgrade a thirdparty lib in one project without having to fear that the upgrade breaks other projects using the same lib.
cons:
You'll have to create or copy and adjust the property pages for every new project that uses thirdparty libs. If you have a new project every few days, that can be a measurable amount of work. Consider to make a template project with a very general properties page and copy it around for every new mini-project.
On my projects, I use different sets of property pages per project, in the same solution, e.g. for unit test projects linking to the unit test framework and so on.

Related

Set up Visual Studio to enable Access to other projects and how to make projects able to reference each other (C++)

Very newb question on this, but most things I read are overly complex or hop between 10 things without saying anything.
I came from Java, and want to learn C++. I have made a small project (5 classes + main) that would be useful in many future projects I want to attempt.
I am trying to set up Visual Studio such that I can call the class set of this project similar to how libraries are called, while referencing other libraries as needed. I managed to add this project to the intellisense (I think that is the right word) on a new project by
right click project >properties > Config Properties > C/C++ > General > Additional Include Directories.
Running the new project fails though due to "unresolved external symbol" errors.
Ideally, I would be able to call the classes and functions of this project like other libraries, and be able to ignore structure, and have it so I can expand this easily, such that I could have a personal Math folder, Map folder, and others be accessible with just #includes and then running it.
Visual Studio Version Info:
Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.1.2
I don't even know if it is possible, but I think it is, as it would be hellish to build large games or programs without the ability to cross reference other stuff easily.
If you need to create and use static library, you need to read this issue.
If you need to use dynamic library, you need to read this issue.

Is there a way to create a default template for includes, libraries etc for visual studio 2019? (c++) [duplicate]

This question already has an answer here:
How to change default code in Visual studio
(1 answer)
Closed 1 year ago.
I would like to eliminate the hassle of including the same libraries in every project. Is there a way that I can make a template for new projects which includes certain libraries in visual studio 2019, or perhaps some way I can include these libraries globally so that they can be included like the standard library? If not, why is this behavior undesirable? thanks
ANother solution (I believe only applicable if you use msbuild rather than cmake) is to edit the default platform property sheet.
These are found via the View -> Other Windows -> Property Manager menu item (requires having an msbuild-based project open).
Open the project node then one of the build configuration nodes, right click on Microsoft.Cpp..user and select Properties (I am blind so don't use a mouse, double clicking the node may also work, not sure about that) and edit it like any property sheet. The imported property sheets are actually how default properties like the libraries and include paths are generated, although digging through them all can quickly become a mess.

How to check the dll files required by my c++ file [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I use Visual Studio 2017 Community for C++ coding. I have made a simple win32 console app and do not want to expose my code. I have also found the .exe file in the debug folder of the solution. When I try copying the .exe file in the Debug folder in another folder it says that the dll isn't found.I also tried copying the whole folder but the same error occurs. Please help me...I want to run my app on another computer also.
You can Generate Code Map for Solution.
Navigate to Architecture –> “Generate Code Map for Solution”
Generates a code map like:
Which shows the inter-dependency between modules and libraries.
In your case by just copying the exe, you are breaking the references to all of the required libraries. Depending on your scenario, you have two good options. Copy the entire source tree + dependencies for you project and recompile it in the new working directory or create an installer which will allow you to distribute dlls and any other required resources.
This is more complicated that one might hope. To answer the question in the title, you need Dependency Walker. (The web site doesn't mention Windows 10, but this stuff hasn't changed much recently, so don't worry about that.)
To distribute the program to another machine, you need to create a release build (the debug run-time libraries are not redistributable). Once you have done that, you will almost certainly find that the other machine already has the release run-time library, but you will need to copy other libraries.

Visual Studio C++ Multi-Project Solutions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I typically use Linux to do all of my development, but have to use Visual Studio (2013 Professional, if that matters) for the project I'm working on now. I've used Visual Studio for projects in the past, and set up multi-project solutions where there were .lib and .dll files generated and all linked together by the compiler at the end to make an executable, or several. However, I've only ever set up these projects through the strange process of setting up dependencies, adding one project's directory to another projects include directory, adding the the library to the dependent projects linked libraries, etc. I'm used to the way Eclipse does this, where it give you a list of all the projects in your working set, and you can select what projects a given one is dependent on, and it will set all of this up for me. I've searched around and found nothing on how to do this simply in Visual Studio like I can in Eclipse. Is there no way to simply automate this task without resorting to the extreme of writing my own add-on, or is there one like this already in existence that I've yet to find?
Edit: I am referring to C++ projects
You must add a project-to-project reference in:
Common Properties/Framework and References
According to Microsoft, adding the Reference in Framework and References is the preferred method in Visual Studio 2010 and later. More info here: http://blogs.msdn.com/b/vcblog/archive/2010/02/16/project-settings-changes-with-vs2010.aspx

Build a C++ project with debug files [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a Visual Studio solution in C++ containing 27 projects with known build order and everything else, I can successfully build entire solution and everything works fine, As you know after building each project some files will produce in "Debug" (or "release") folder and I access to them for each project, 26 projects of this solution needs no change, I just want to change one project, So I just wondered if I can use produced debug files of all 26 other projects and build my solution again in Visual Studio or any other IDE?
Thank you so much
The 'debug files' of visual studios are *.pdb files and are a proprietary MS format and therefore cannot be used in other IDEs:
What is the structure of a PDB file?
The intermediate files of VS '*.obj' are generated for every translation unit but a conversion to another compiler is not achievable in an easy way:
Is there a tool that can convert a Visual Studio object file to GCC format?
If you already have the VS solution you can make changes to the project you want to edit and VS will ensure that every project that needs a change will be recompiled and linked if you build the solution.
If you want to spare time you can tell VS compile the project you are working on instead the entire solution. You might stay with VS if that works for you.
Adding support for another build-system or IDE should be done by an experienced developer who is familiar with those projects.
In theory, Visual studio will spot what has changed (in a solution) and just saying build should just build what has changed (and its dependencies).
Beware if using the libraries and exes from one compiler with those of another - you almost certainly need to use the same version of Visual Studio, since for example the implementations of the stl will change between version.
Furthermore, if you use a different compiler things will almost certainly go horribly wrong.
If you use another IDE and point it to the same compiler, things should be ok.
edit
If by "another IDE" you mean another instance of the same IDE, i.e. you want to open a different solution, but use this as a "library" that's fine. You don't need the .obj files - they are part of the build process. It's the final .lib or .dll files you need, together with .pdb files if you want the debug symbols.