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

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

Related

How do I properly compile and link a resource file using MSVC command line toolchain? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I am a beginner to Windows API, and trying to learn how to make applications and such. I got to this part in the winprog.org articles, where the author started using resource files. I have written the resource file, in the .rc format. I compile it using the rc command, and it compiles into a .res file. Then I pass it off to the linker along with the the main object file, again, all from the command line. But when I run the linked executable, it does not show me the menu I defined in the resource file. Nor the icon I specified in there.
I am using Visual Studio Code instead of Visual Studio, partly to get comfortable with the MSVC CLI, and partly because I just like VSCode better. I also don't want to install additional C/C++ compilers when I already have MSVC.
So,
How should I go about compiling and linking the resource file correctly?
Are there any more up-to-date and not nightmarish methods to learn how to work with the Windows API?
You compile the resource script using the Resource Compiler (rc.exe) and pass its output on to the linker. There is no other magic involved.

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.

Are there any tools for reviewing include or import code structure/hierarchies? [duplicate]

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 looking for a tool (preferably, a Visual Studio plugin) that would display all files included by a given file and show all files included by those files and so on.
First, cinclude2dot.pl is a perl script which analyses C/C++ code and produces a #include dependency graph as a dot file for input into graphviz.
http://www.flourish.org/cinclude2dot/
If you don't want to go the way of that sort of manual tool, then the hands-down by far winner is in my opinion a tool known as "IncludeManager" from ProFactor.
http://www.profactor.co.uk/includemanager.php
There's a free trial, and it is awesome. It's a plug-in for Visual Studio that's totally integrated so double clicking on something over here takes you to the place where it is included over there.
Tooltip mouseovers give you all the info you would want, and it lets you drill down / up, remove whole subtrees you don't care about, view representations other than graphs, cycle through a list of matches for this and that, it's wonderful.
If you're quick about it, you can refactor the #include structure of a large projects before the trial runs out. Even so, it doesn't cost much, about $35 per license.
For what it does, it is just about perfect. Not only #include graphs but also cross project dependencies of shared files, impact on build times, detailed properties in grids, perfect.
Doxygen, with the aid of Graphviz, can do that. You first need to edit a configuration file. This won't be easy the first time you do it, but no much editing is needed afterwards.
Not quite what you want perhaps, but the Visual Studio compiler (cl.exe) has an option /showIncludes which will show you a tree of the includes when you compile a file.
If you want this information for a single file then you can right-click on the file in the Solution Explorer, select "Properties", and in the "Command Line" section just add /showIncludes to the "Additional Options". (Note I'm using VC++ 2005, so it may be different for newer versions).
The output that you get is a little... convoluted, but it shows you what gets included and in what order.
Incidentally, the same feature in GCC and the Intel C++ compiler (my versions at least) is -H.
You can try the method suggested by this Stack Overflow answer:
There is a C/C++ -> Advanced project setting "show Includes". That
will generate the tree. It maps to the compiler switch /showIncludes
If you are using Visual Studio 2010 you can use the new Visualization and Modelling Feature Pack from Microsoft, which has a feature to generate an include graph. This is only available through an MSDN subscript though.
Not in your preferences, but doxygen does that quite well.
http://www.codeproject.com/KB/applications/includefinder.aspx
This is not a VS plug-in but can be a starter for your own tool. As far as I could see it reads VC6 projects only, the newer VS have an XML format easy to parse. What you need out of it are the default include paths so the tool can find the included files. Alternatively you could provide a settings box for it in the GUI as user input.

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.

Separate property pages for Visual C++ 2010 / 2012 [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 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.