I am playing with someone's project on GoogleCode. When I add include<string> and compile it, I got
1> Toolbar.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): error C2220: warning treated as error - no 'object' file generated
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
From
/EH (Exception Handling Model),
I know I have to Exception Handling Model. But in this project's property page, there are only four fields under 'Configuration Properties':
General
Debugging
VC++ Directories
NMake
Unlike in a new Win32 project created by Visual Studio, I can't find C\C++. Should I set Exception Handling Model in makefile file? And what exactly I have to do if I want to set this mode to Yes(/EHSC). Thanks in advance.
Here is the makefile.msvc file in this project's root folder. Since it is long and I found it is difficult to format its text content to code sample here, I upload it to a upload provider. Here is the link. If there is an better option than doing so, please let me know.
My MakeFile.msvc
Yes, since you have a make (nmake) project, you are supposed to set everything yourself in the makefile.
Post the makefile or a relevant snippet and we can point out the place where to add the flag. Usually it will be either a line that references cl.exe or a variable named CFLAGS or similar. It depends which convention the creator of the makefile chose.
Related
Steps to Reproduce:
Create new Visual Basic Analyzer with Code Fix (NuGet + VSIX)
From VSIX project add New Item...
Extensibility/Custom Command called "CustomCommand"
Not required but helps see the issue set the following options
Option Explicit Off
Option Strict Off
Option Infer On
Build Solution
Several files are added and you get 381 warnings for the ComandComand.vb and CustomCommandPackage.vb files. The warnings are "Type or namespace definition or end-of-line expected", "Newline in Comment", "Type Expected" , "Too many characters in character literal"., "Comma Expected". None of which make any sense in a VB file. If I included these files in a C# project and rename them to .cs I get the exact same errors. The errors make no sense for a .VB file.
The example above is complete and shows a bug in Visual Studio 2015. In the VSIX project file there are two lines that include the word "CSharp" that must be changed to "VisualBasic" otherwise the VB code will be compiled by the C# compiler. To edit the file, unload the VSIX project from within Visual Studio, replace occurrences of "CSharp" with "VisualBasic", Save and reopen the solution the 381 Errors/Warning will go away.
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."
There seem to be two paths containing Microsoft Visual Studio runtime source files:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\crt\src
and
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
Some files appear in both directories, but have different sizes. I looked at one file in particular and it had the same method defined in both files.
So my question is, what is the difference in usage for the two paths? I would like to know when I am debugging (I dont mean debug mode) in Visual Studio, which file is the code on the screen?
The include directory has all of the public headers. These are headers that you can include in your code, like <stdio.h> and <type_traits>, plus implementation headers required by those headers.
The crt\src directory contains the CRT sources, including most of the .asm, .c, and .cpp files used to build the CRT. This directory also has a copy of many of the CRT headers, and in some cases these headers are different from what are in the include directory. This is purely an artifact of how the CRT was built.
When debugging into inline code defined in the CRT headers, the debugger should always pick the right header. If both directories contain the same copy of a header, then the debugger will just pick one and since the headers are the same it doesn't matter which one it picks. If the headers are different, then which header the debugger picks depends on the object into which the inline function was compiled. If the object is part of the CRT, you'll step into the header from crt\src; if the object is from one of your source files, you'll step into the header from include. Basically, the debugger should always be able to find the correct copy of the header.
We've greatly simplified this in the Visual Studio "14" CTP. There are no longer any public headers in the crt\src directory, and the headers that are shipped in the include directory are the same ones that were used to build the CRT.
The CRT sits at the bottom of the Visual C++ libraries stack: the rest of the libraries depend on it and practically all native modules depend on it as well. It contains two kinds of stuff: (1) the C Standard Library and various extensions, and (2) runtime functionality required for things like process startup and exception handling. Because the CRT sits at the bottom of the stack, it is the logical place to start the process of stabilizing the libraries.
From The Great C Runtime (CRT) Refactoring by James McNellis:
(1) We ship most of the sources for the CRT with Visual Studio; you can find them in the Visual Studio installation directory under VC\crt\src.
(2) In Visual Studio 2013 there are 6,830 #if, #ifdef, #ifndef, #elif, and #else directives in the sources that we ship with the product; in the Visual Studio "14" CTP there are 1,656. These numbers do not include directives in headers and they do include the STL source files which are largely untouched by this refactoring effort, so this isn't a perfect measurement, but it's indicative of the amount of cleanup that's been done.
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:
I just installed the Windows Phone developer tools, because I want to play with the phone and possibly publish some application(s).
However, after creating a default project, I'm presented this when I try to compile:
The tag 'Panorama' does not exist in XML namespace 'clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls'
What mistake have I made?
EDIT: I missed part of the error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Phone.Controls". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\Microsoft.Phone.Controls.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\Microsoft.Phone.Controls.exe", but it didn't exist.
For SearchPath "{RawFileName}".
Considered treating "Microsoft.Phone.Controls" as a file name, but it didn't exist.
For SearchPath "Bin\Debug\".
Considered "Bin\Debug\Microsoft.Phone.Controls.dll", but it didn't exist.
Considered "Bin\Debug\Microsoft.Phone.Controls.exe", but it didn't exist.
Just got this error! In my case I was manually adding some pre-existing XAML's (among them, some with panorama) to a project which didn't have any panorama page.
Basically what I did was add a new "Windows Phone Panorama Page", which made VisualStudio include some additional references that was missing, and now the project is loading smooth.
It appears to me that the SDK somehow failed to install some of the required components. I would recommend reinstalling the SDK first and see where you can get from there.