my F# project, working up til now, started erroring on:
Error 54 The namespace 'Vision' is not defined
I've include some images from Visual Studio that show the situation:
SO, I don't get why this built before and now won't build. The refs are there, the namespaces are in the refs. What am I missing?
#brent - bingo. I had it a .net 4.5.2 but the assemblies only support 4.5
Related
I downloaded Qt6.1.2, I installed the Qt tools extension in visual studio 2019 and I added the version its path. Whenever I start a new Qt widgets application project I get a lot of errors like this one:
abc Error (active) E2783 expected a comma (the one-argument version of static_assert is not enabled in this mode) Project_Name C:\Qt\6.1.2\msvc2019_64\include\QtCore\qanystringview.h
or this one
abc Error (active) E0325 inline specifier allowed on function declarations only Project_Name C:\Qt\6.1.2\msvc2019_64\include\QtGui\qrgb.h
And for the records the Qt creator works just fine but I need to write code on visual studio.
I had the same error, and going to the solution explorer and right clicking properties->General, and changing the C++ Language Standard to C++ 17 (it was C++ 14) fixed the errors.
I learned this from the YouTube video posted by Alex Toma: https://www.youtube.com/watch?v=heiyPLJLBS8
So the credit goes to Alex - thanks!
I am trying to create windows store build using Visual studio 17 with Universal Windows App Development tool.
When I create a build from unity, it creates a visual studio solution but finishes with a lot of errors.
When I try to build the resulting visual studio solution, it fails to generate a build.
I am attaching related settings and build outputs screenshot in sequence that I encounter them.
My unity build settings
Unity console errors on Build complete
Vs error on opening/building VS solution output
Can anybody help with this UWA tool. I am trying this for the first time.
It is because Unity .Net version and UWP .NET are not the same. They have much in common and also some differences.
For instance, you can build and import in VS. Then you have async/await available which are not in Unity.
For your case, here's an excerpt from there : https://msdn.microsoft.com/en-us/library/mt185488.aspx
"This topic displays the types in the System.Security and
System.Security.Principal namespaces that are included in .NET for UWP
apps. Note that .NET for UWP apps does not include all the members of
each type. For information about individual types, see the linked
topics. The documentation for a type indicates which members are
included in .NET for UWP apps."
I am running a DirectX 11 application on windows 7 and visual studio community 2015 RC. I'm still using functions from the DX SDK. It worked fine on VS2013 but when I switched over I get only the following error:
Error LNK2019 unresolved external symbol __vsnprintf referenced in function "long __stdcall StringVPrintfWorkerA(char *,unsigned int,unsigned int *,char const *,char *)" (?StringVPrintfWorkerA##YGJPADIPAIPBD0#Z) Ancora D:\Moody\Moody\Projects\Projects\Ancora\Ancora\dxerr.lib(dxerra.obj) 1
I only use the DXGetErrorDescriptionA function from the dxerr library and when I comment it out, the program compiles fine. I have no idea what's wrong but it can't be from the DX SDK or otherwise the other functions would fail right?
I experienced the same problem using DXGetErrorMessage() with Dx9 and found out that MS have provided an additional library to include in the Additional Dependencies properties page to address this problem. The library name is: legacy_stdio_definitions.lib
Adding this resolved the issue for me.
just add
#pragma comment(lib, "legacy_stdio_definitions.lib")
https://msdn.microsoft.com/en-us/library/bb531344.aspx
Instead of hacking dxerr.lib manually, you could add
#include <Windows.h>
#include <stdio.h>
int (WINAPIV * __vsnprintf)(char *, size_t, const char*, va_list) = _vsnprintf;
somewhere in your code
The legacy DirectX SDK is quite old, and dxerr.lib in the DXSDK is not compatible with VS 2015's C Runtime as you have encountered.
In general static libraries with code in them don't mix well from different versions of the compiler. Most of the .libs in the legacy DirectX SDK work with VS 2015 because they are import libraries for dlls or all data libraries and therefore contain no code at all. The DXSDK has not been updated since VS 2010.
Aside: The VS team has made a heroic effort to keep the Visual C/C++ Runtime link compatible between VS 2015 Update 3, VS 2017, and VS 2019 per Microsoft Docs. This is not the normal pattern.
Be sure to read the instructions on Microsoft Docs on the proper way to mix the legacy DirectX SDK with the Windows 8.x SDK used by VS 2015. You are presumably using something else from the legacy DirectX SDK in this project besides dxerr.
I have implemented a version of DXERR that you can build from source in your project to remove this dependency of the legacy DirectX SDK. See this post for details. That said, I purposely only supported Unicode (the W version). You can work out how to make the ANSI (the A version) easily enough, but it would be best if updated your app to use Unicode.
See Where is the DirectX SDK (2021 Edition)? and DXUT for Direct3D 11.
UPDATE: As noted in another answer linking with legacy_stdio_definitions.lib should make the old legacy DirectX SDK version of dxerr.lib link again with VS 2015/2017. That said, you should work on removing dependencies on the legacy DirectX SDK as much as possible and DXERR is easily replaced by your own module. See Living without D3DX.
The DirectX libraries you are using are compiled with an older version of Visual Studio than you are using. Microsoft sometimes makes changes to their C runtime, creating incompatibilities between libraries compiled with different versions. __vsnprintf was an internal symbol in older versions of their C runtime, it does not exist in the 2015 RC version.
Unfortunately, dxerr.lib (along with d3dx11.lib) have been deprecated. You have two options - you can switch back to VS2013 or you can stop using functionality from dxerr.lib. The latter is probably better, because you can duplicate its functionality by using FormatMessage now (more info in the linked article).
HACKY but you could patch dxerr.lib.
Replace __vsnprintf with _vsnprintf (with a null at the end to account for the removed underscore at the beginning)
You can change the Platform Toolset from Visual Studio 2015 to Visual Studio 2013 and then it compiles.
The Platform Toolset is found on the General tab of the Project Properties.
Found a lot on this error already, but my case does not get matched with any yet.
I am building a solution (having many projects) in debug mode, and one of them is throwing this error, I am using VS2010 and language is C++, .net version 4.0, earlier this project was compiled in vs2008 and then VS2010, and it was all ok, now I got a new machine which has just VS2010 installed and now facing this error.
Main thing to notice is:
Properties settings:
Project Configuration->General->/CLR is chosen
In C++->General-> No CLR support
I am having these settings since past, it's running all fine in my old machine in VS2010 only in the same debug mode.
What to do?
I am using Visual Studio 2013.
I had similar symptoms for a very simple C program. In the project properties I changed the General / Platform-Toolset setting from "Visual Studio 2010" to "Visual Studio 2013 v120" and that got rid of this error for me.
As the error indicates, precompiled headers are not compatible with /clr-compiled files.
You can disable precompiled headers for the cpp files that are compiled with /clr or for the whole project (C/C++ -> Precompiled Headers -> Precompiled Header : Not Using Precompiled Headers). I'm not sure what the difference is but both seem to work for me.
Doc is not exactly wrong, but I'm betting that's not what's going on here.
Do you by any chance have something like THIS:
#using namespace boost::asio;
...instead of something like THIS?
using namespace boost::asio;
Both "using" and "#using" have valid roles in Visual Studio-- but if you mean the pure C++ language keyword, be sure you are using the former! The latter is indeed used for managed code. See here:
https://msdn.microsoft.com/en-us/library/yab9swk4.aspx
Getting this wrong in Visual Studio 2015 has the following effects:
BUILD OUTPUT:
1>thingy.cpp(3): error C2006: '#using': expected a filename, found 'namespace'
1>thingy.cpp(3): fatal error C1190: managed targeted code requires a '/clr' option
Note that attempting to "satisfy" this in a fit of 4:00 AM frustration by removing the "namespace" keyword and quoting the value will result in only the second error.
(I think that's worth mentioning, because as both Visual Studio and the C++ language specification continue to change, people try all kinds of syntax that they know shouldn't work, and if it suddenly compiles, just assume the spec or the tools have changed in some way they haven't had time to keep up with-- especially if the error messages seem to have something to do with "features" they couldn't care less about, and don't use.)
I get this error when linking a Visual C# .NET framework 4.0 supported project as I added a reference of C++ CLR DLL with 4.5 .NET Framework.
error CS0246: The type or namespace name 'project' could not be found (are you missing a using directive or an assembly reference?)
As a result, how do I downgrade .NET framework 4.5 to 4.0 in Visual Studio 2012 for this C++ CLR supported DLL project?
I have seen this before which was the cause. For my C++, this link may help out my cause http://msdn.microsoft.com/en-us/library/bb772098(v=vs.90).aspx
I just discovered this warning as well:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3274: The primary reference "X" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
Anyone seen this before? So how I downgrade the C++ DLL?
Thanks
The C++ IDE doesn't support multi-targeting for .NET projects. You'll need to edit the .vcxproj by hand. Close the project if you have it open and open the .vcxproj in a text editor. Locate this line:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
and modify it to "v4.0". Open the project again in VS. Project + Properties, Common Properties, Framework and References. Select "System" in the list and check the Relative Path property. It should now point to the 4.0 version.
Do beware of a significant issue and the core reason that the C++ IDE does not support multi-targeting. There is a problem with the #using directive, it loads assemblies from the c:\windows\microsoft.net subdirectory. Which will get it to load a .NET 4.5 assembly instead of the 4.0 assembly that you want when you target 4.0. The 4.0 reference assemblies are stored in c:\program files\reference assemblies. This can cause very hard to diagnose runtime problems, the 4.5 assemblies are not that compatible with the 4.0 assemblies. It is easy enough to avoid #using in your own code but it used in the include/msclr/marshal.h and include/vcclr.h header files. Caveat emptor if you use these headers.
I have figured it out. It was the warning but the link specified did fix the problem.
http://msdn.microsoft.com/en-us/library/bb772098(v=vs.90).aspx
what worked for me was: in the project properties -> configuration properties -> project defaults. .NET Target framework version - edit to the version you need - in my case 4.6.1