Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio unable to recognise my MFC library for my webcam laser rangefinder code

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.

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 ==========}

like image 516
user3236892 Avatar asked Jan 26 '14 06:01

user3236892


4 Answers

Question : Where do I "change the project property to Unicode"?

Answer :

For C++,

Right Click the project, and select properties, ( or Alt-Enter ) Property Pages should open

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.

like image 193
Joe B Avatar answered Oct 26 '22 15:10

Joe B


right click your solution, go to properties and set the project properties to use Unicode instead.

like image 43
rockinfresh Avatar answered Oct 26 '22 16:10

rockinfresh


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

like image 14
thoma Avatar answered Oct 26 '22 15:10

thoma


I encountered the same issue while building solution in Visual Studio and it got resolved when installed below components:

  • MFC for C++
  • Common tools for C++
  • Windows 8.1 SDK and universal CRT SDK
like image 1
Pooja S Avatar answered Oct 26 '22 15:10

Pooja S