Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio include path can't see into /mnt/ #2371

Closed
haydentech opened this issue Jul 26, 2017 · 8 comments
Closed

Visual Studio include path can't see into /mnt/ #2371

haydentech opened this issue Jul 26, 2017 · 8 comments
Labels

Comments

@haydentech
Copy link

Launching a compile with Visual Studio's command-line compiler, and using a full include path into /mnt, produces an error:

cl.exe -c -I/mnt/c/git/foo/include test1.c
test1.c(11) : fatal error C1083: Cannot open include file: 'includes.h': No such file or directory

The file does exist:

ls -l /mnt/c/git/foo/include/includes.h
-rwxrwxrwx 1 root root 56212 Jul 21 13:44 include/includes.h

However, if I use relative paths when I run the command, it works:

cl.exe -c -I../include test1.c
Versions Used:
Microsoft Windows [Version 10.0.15063]
Visual Studio 2013

This same compilation run works successfully under Cygwin, for whatever that's worth.

@therealkenc
Copy link
Collaborator

This is #1397 (message, "This one is more complicated" part) and #1243 (message). Try:

$ cl.exe -c -IC:git/foo/include test1.c

@haydentech
Copy link
Author

@therealkenc You were on the right track. This is what eventually worked:

$ cl.exe -c -IC:/git/foo/include test1.c

This will require changes to our build process though. If we could use /mnt/c/... it would "just work" in the same way it does for all other platforms (including win32 under cygwin).

Thanks!

@therealkenc
Copy link
Collaborator

Yeah sorry I cut-paste-edited from your message blind 😳. Those links above have some expository on why it is difficult/problematic to implement. I maintain it is doable with a big enough hammer. But it's a big hammer that certainly isn't destined for the Fall Update.

@benhillis
Copy link
Member

This is definitely an area I would like to improve in the future.

@haydentech
Copy link
Author

So we've discussed Windows program using WSL paths. Is there any hope for the inverse functionality, where the Linux environment could use Windows paths? As a simple example, this command works fine in cygwin, but fails in Ubuntu-on-Windows:
cd C:

@sunilmut
Copy link
Member

sunilmut commented Aug 1, 2017

@haydentech

Is there any hope for the inverse functionality, where the Linux environment could use Windows paths?

There are no plans for that right now. But, if there is a scenario that interests you and is not currently implemented, you can help us prioritize it by voicing your opinion through the user voice portal.

@therealkenc
Copy link
Collaborator

Is there any hope for the inverse functionality, where the Linux environment could use Windows paths?

The problem isn't even really the "no plans" part. The problem (if that is the right word) is bash uses colon as the path separator. You can make C: a symlink to /mnt/c right now. So even if you vote this though the roof, you still need to patch bash not WSL. The '\' '/' difference is mostly (though not entirely) a non-issue because the Windows side is okay with both already, and you'd be going out of your way to escape backslash in WSL. There is a similar post related to git #1855 (message).

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants