2

I'm playing with Visual-Studio 2017 c++ cross platform projects (linux). I was able to compile and run a single executable project.

Now I've created two c++ projects. One is a static library, the other is a dynamic library. The dynamic library uses a class from the static library, so I have an #include statement for the corresponding header file that contains the class definition. Compilation fails saying the header file is not found. I added the include directory to Additional Include Directories in the project properties (which usually works with windows vc++ projects). However, it looks like the header file is not copied to the remote linux env (WSL).

I don't want to add the include file to the dynamic library project because there is a reason why Additional Include Directories were invented.

Is there a way to configure the build to copy Additional Include Directories to the remote env?

Joy
  • 1,171
  • 9
  • 15
lev haikin
  • 558
  • 4
  • 17

1 Answers1

1

Files referenced thru Additional Include Directories are expected to be on the Linux remote already, VCLinux doesn't copy them for you. And, to be honest, you wouldn't want it to because additional includes are often third-party packages.

But if you've built the static library then it's source, including headers, will be present on the Linux remote. Specify the paths to the static library headers and library on the Linux system thru the project settings.

stanthomas
  • 1,141
  • 10
  • 9
  • Thanks! Makes sense. Will try that out. – lev haikin Sep 15 '17 at 05:34
  • I tried specifying the path, however it doesn't work well. The following link describes the problems very precisely, and the proposed solution worked for me: https://developercommunity.visualstudio.com/content/problem/40127/additional-include-folders-problems-for-linux-proj.html. Is there a better way? – lev haikin Sep 24 '17 at 11:03
  • The report you linked describes the problems with specifying remote paths very well. And there's an open issue about it on the VCLinux GitHub site : https://github.com/Microsoft/VSLinux/issues/68 . The issue is not resolved in the current VS2017 15.4 preview 2.0. Looks like we have to live with this a while longer. – stanthomas Sep 25 '17 at 10:47