Rabadash8820
Rabadash8820

Reputation: 2524

NuGet Not Adding Include Directories

I am developing an application with VS Professional 2013 that uses a NuGet package called SFML. I am now trying out the Express edition of VS 2015, and I wanted to test it by building this application. The app's source code is on GitHub, and I can clone the repository into a new local directory and open it in VS 2015 just fine. When I build, the NuGet packages are restored and the "packages" folder is added to the local solution folder. However, the C++ code itself fails to build, throwing the compiler error:

Error (active) cannot open source file "SFML\System\NonCopyable.hpp"

at a line that reads

#include <SFML\System\NonCopyable.hpp>

This error never occurred in VS 2013, which I assumed was because NuGet added the appropriate paths to the project's Additional Include Directories. Is that not happening now because of a NuGet issue or a VS 2015 issue, or just because I'm missing something? Is there any way that I can resolve this issue using my current 2015 Express edition?

Thanks in advance!

Upvotes: 3

Views: 5115

Answers (1)

Malcolm McCaffery
Malcolm McCaffery

Reputation: 2576

I had the same issue. In my example I noticed my NugGet package had v120 in the name Microsoft.AspNet.SignalR.Client.Cpp.v120.WinDesktop I was getting error unable to find include file pplx\pplxtasks.h

To fix this issue:

  1. Right click your Project in Solution Explorer and select Properties
  2. In Configuration Properties - General change Platform Toolset to the version matching your NuGet package - in this case Visual Studio 2013 (v120)

More detail on changing platform toolset here: https://msdn.microsoft.com/en-AU/library/ff770576.aspx

Now the project compiles correctly.

Upvotes: 4

Related Questions