How does visual studio 2010 treat .lib files that are not used - visual-studio-2010

according to my another question , suppose that I have a .lib files and I don't know which .lib a specific function belongs to?
Somewhere I studied if I link all of that .libs this will not effect the size of my final project?
Because VC won't install .libs that are not used in the final?
Is it true?
Can you explain me the mechanism that VS uses to link libraries?
Edited section of my question based on #HansPassants comment. How can I see the contents of a .lib file using Dumpbin.exe
I have searched my Visual studio's install folder and found the file:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\dumpbin.exe
But when I double-click on it, I get the error:
Could you learn me how to use dumpbin.exe. e.g. how to introduce a .lib file to this .exe and then extract the contents of it?
Edited section of my question based on #Roger Rowland's comment
I runned dumpbin.exe from Microsoft Visual Studio 2010 command prompt and this is what I have reached for the agg.lib. How can I explore the contents of the .lib. I mean how can I understand a specific method is written in this .lib or in another?
How can I understand which .lib should I link in order not to get error when running a specific method?
Please learn me how to export contents of a .lib
This is what I have done already. The commands that I have entered are:
C:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\> D:\JobList\Lib\GDAL_lib\x86\lib\agg.lib\EXPORTS
C:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\> D:\JobList\Lib\GDAL_lib\x86\lib\agg.lib/EXPORTS
The screenshot of what I have tried up to now:

Related

How can I include windows WexTestClass.h in a c++ project

I've been trying to find this header file everywhere. This is part if Microsoft's Unit Test API, that doesn't seem to be very well documented.
All I know is that I need to download and install the Windows Driver Kit, which I have, but where do I find this header file and all associated include files for this project?
I have Visual Studio 2017 and Windows and Driver Kits 10.0.15063.468 respectively
I checked C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0 but that header is not there, it doesn't automatically get recognized by visual studio either.
Thanks
I found it under C:\Program Files (x86)\Windows Kits\10\Testing\Development\inc

Building C/C++ projects with ASM modules in Visual Studio 2010

I'm feeling like an eejit right now. I have been using Visual Studio 2010 Professional successfully for C/C++ projects for quite some time. But now I have a project that also includes a couple of ASM files (written for the Microsoft Assembler). I read a few articles about enabling MASM in Visual Studio. I followed the instructions for checking the boxes for MASM and MASM64 in the project's Build Customizations. Then I saved the Project and reopened it. But now it cannot load the project and gives this error message:
The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\masm64.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
Where do I find this masm64.targets file or how do I create it? It is not anywhere on the disk.
Thanks for any guidance.
A tip for anyone who runs into the same problem, I found masm64.targets on GitHub:
https://github.com/MMOCOM/OSIE-GF/blob/master/Rules/masm64.targets

VisualStudio 2015 RC Issue with Includes

Pulling out my hair on what should be a simple issue with using VC++ and being unable to access the default includes.
After installing Visual Studio 2015 RC, I can no longer build C/C++ projects. I receive "IntelliSense: cannot open source file '*.h'" errors for all the various standard library *.h files.
I confirmed that my files do exist in the default locations (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include), and if I right-click on my #include <cstdio> line in the editor I can choose "Open Document" and it even opens automatically in the editor.
My Include Directories string in the Project Settings is:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\Users\Kristopher\Libraries\Includes;$(VC_IncludePath);$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);‌
Has anyone else run into this? I feel like I'm overlooking something simple.
Your IncludePath should not specify the Visual C++ and Windows SDK include paths directly. Instead, it should specify only the paths specific to your project and derive from the IncludePath defined in the common C++ MSBuild targets. E.g.,
<IncludePath>C:\Users\Kristopher\Libraries\Includes;$(IncludePath)</IncludePath>
To address your particular case: In Visual C++ 2015, the bulk of the C Runtime (CRT) has been refactored into a new Windows operating system component, the Universal CRT. Its headers and libraries are now in a different location and your project fails to include this include path into the IncludePath property. Specifically, you need to include $(UniversalCRT_IncludePath). For more details, see the article I wrote earlier this year, "Introducing the Universal CRT."

Visual Studio header not found (Qwt)

I would appreciate some help with the following: I'm writing a program in Visual Studio 2010 using the Qt addon, and I needed to plot some data. Consequently, I installed Qwt. The Qwt widgets are avaliable in Qt Designer (so I've done something right!). My problem is, whenever I try to reference Qwt ('include '), Visual Studio tells me that it cannot find the requested header. I've added 'C:\Qwt-6.0.1\lib\' to my 'Path' environment variable. I thought that this would be enough for Visual Studio to see it.
I'm not yet very proficient with Visual Studio. How can I ude the Qwt library in Visual Studio?
I've found that I can use Qwt's libraries in Qt Creator, just by adding 'CONFIG += qwt' to the pro file; however, my created Qt project (created in Visual Studio 2010) does not have a pro file. It has the Visual Studio equivalent.
Thanks.
Adding these paths to your PATH environment variable does nothing.
For Visual Studio to find the appropriate headers, you will need to tell it explicitly where they are. That is, you will need to add the path to the header files as one of the so called "additional include directories" of your project.
The same goes for other elements such as library directories, should you be linking against libs. The libraries themselves (their file names) can then be added under the "Additional Dependencies" at Linker >> Input.

Visual C++ 2010 Runtime Libraries prerequisite keeps popping up on a VS 2010 created installer

I created an installer with Visual Studio 2010 Version 10.0.40.219.1 SP1 Rel. My application is built/compiled for x86 and requires VC++ runtime libraries. Thus, the setup project is configured with VC++ runtime libraries as a prerequisite.
Every time I run the installer I get the popup "The following components will be installed on your machine." "Visual C++ 2010 Runtime Libraries (x86)". The first time it gets installed asa expected. The second and subsequent times it asks me whether to repair or remove VC++ 2010.
This popup should only be displayed once, the first time it is discovered that VC++ redistributable is not installed.
Has anyone seen this? Anyone know how I can fix this?
Solution:
The answer I accepted gave me what I needed to resolve the issue. Here are the details on what I did to fix this, which was very simple in fact. I edited the file:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x86\product.xml
In this file you will find the following:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{6EE91C1A-A2E7-38CD-AEBB-3B900A4D8868}"/>
</InstallChecks>
The above contains the incorrect product code. Replace the above with the correct product code for the Visual C++ 2010 SP1 redistributable as follows:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}"/>
</InstallChecks>
The link here shows the correct product codes for the various VC++ 2010 Redistributables.
This happens because the prerequisite detection criteria is incorrect.
A solution is to create your own custom prerequisite with a correct criteria. Perhaps this article will help:
http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx
Visual Studio setup projects do not support this. But it can be done by manually generating the required manifests.
You can find the manifests structure here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
These manifests can be generated automatically with the Bootstrapper Manifest Generator tool.
After generating the package manifests, you can add all these files (including the package) in a separate folder in the Visual Studio prerequisites folder, for example:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
You can then select the prerequisite in your setup project properties page.

Resources