This is my first time fiddling with the windows world in over a decade, so this may be a simple fix. But I'm completely stuck.
Say you have a source directory,
mkdir helloworld && touch helloworld/helloworld.{h.cpp}
helloworld.cpp:
#include "helloworld.h"
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
return 0;
}
helloworld.h:
#include <iostream>
Now you have a compile command that looks like:
cl.exe helloworld/helloworld.cpp
My understanding of standard behavior is that preprocessor lookups for quoted includes look
- In the same directory of the source file
- previously opened files
- cli specified -I include paths
- paths found in the INCLUDE environement
Now, this obviously falls into the first category, but I invariably get:
Z:\Projects\temp>cl helloworld\helloworld.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
helloworld.cpp
helloworld\helloworld.cpp(1) : fatal error C1083: Cannot open include file: 'helloworld.h': No such file or directory
So, as I was typing this I had a random thought...."what if it's because my project is on a shared filesystem?".
I copy the same project to C:\ and it compiles fine!
Does anyone have any idea what's going on here?