Closed AndreiDespinoiu closed 1 year ago
Without having access to the code I would say you have an issue with circular dependencies on the Components.h header file, or the same file in different locations. That might not be exposed during a regular build due to the order of includes in the .cpp files using it.
This is not an issue of the extension but a dependency architecture issue on the include dependency tree that might only arise when parsing a header file directly.
tldr: Components.h depends on Components.h
Like I said, my project compiles fine, with either "#pragma once" or with include guards. Meanwhile, Struct Layout only works with include guards.
I understand that. That doesn't mean that trying to just build a header file directly will work if the dependencies are not properly handled. Struct Layout is just running Clang on your code, so maybe your code only works on MSVC compilers or there is something odd with the compilation from the header. Does struct layout produce the same results from a .cpp file? Implementations details on how pragma once works may vary between compilers. As recommended before, if for some reason clang is not able to consume your code, you can always try the PDB extractor instead.
Hello.
I'm using Visual Studio 2019 (Community) v16.11.17, Struct Layout v0.6.3.
The header file in question contains "#pragma once" at the top. It compiles just fine, but I can't use Struct Layout with it. It only works if I replace it with "traditional" include guards like:
This is the output that I'm getting: