C++ Visual Studio 无法识别我的网络摄像头激光测距仪代码的 MFC 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21360411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio unable to recognise my MFC library for my webcam laser rangefinder code
提问by user3236892
I tried copying the source code from the internet directly and I couldn't build/debug the whole file because of the error found below.
我尝试直接从 Internet 复制源代码,但由于下面发现的错误,我无法构建/调试整个文件。
Please Help
请帮忙
Error occurred while restoring NuGet packages: System.ArgumentException: The path is not of a legal form. at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength,Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at NuGet.VisualStudio.VsUtility.GetNuGetSolutionFolder(Solution solution)
at NuGet.VsEvents.PackageRestorer.UsingOldPackageRestore(Solution solution)
at NuGet.VsEvents.PackageRestorer.BuildEvents_OnBuildBegin(vsBuildScope Scope, vsBuildAction Action).
1>------ Build started: Project: LaserRange, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(369,5): error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library. See http://go.microsoft.com/fwlink/p/?LinkId=286820 for more information.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========}
========== 构建:0 成功,1 失败,0 最新,0 跳过 ==========}
回答by Joe B
Question: Where do I "change the project property to Unicode"?
问题:我在哪里“将项目属性更改为 Unicode”?
Answer:
回答:
For C++,
对于 C++,
Right Click the project, and select properties, ( or Alt-Enter ) Property Pagesshould open
右键单击项目,然后选择属性,(或 Alt-Enter ) 属性页应该打开
Under Configuration Properties
在配置属性下
General
一般的
[-]Project Defaults
[-]项目默认值
**Character Set** : Use Multi-Byte Character Set
- Change to -
- 改成 -
**Character Set** : Use Unicode Character Set
Pain in the butt to find it.
痛在屁股才能找到它。
回答by rockinfresh
right click your solution, go to properties and set the project properties to use Unicode instead.
右键单击您的解决方案,转到属性并将项目属性设置为使用 Unicode。
回答by thoma
you need to install MFC MBCS DLL Add-on As mentioned in your error. See the below link http://msdn.microsoft.com/library/dn251007.aspx
您需要安装 MFC MBCS DLL Add-on 正如您的错误中所述。请参阅以下链接 http://msdn.microsoft.com/library/dn251007.aspx
回答by Pooja S
I encountered the same issue while building solution in Visual Studio and it got resolved when installed below components:
我在 Visual Studio 中构建解决方案时遇到了同样的问题,安装在下面的组件时它得到了解决:
- MFC for C++
- Common tools for C++
- Windows 8.1 SDK and universal CRT SDK
- C++ 的 MFC
- C++常用工具
- Windows 8.1 SDK 和通用 CRT SDK