-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Compile error with MSVC #10071
Comments
Someone suggested going into the modules\gdnative\godot\dictionary.cpp file and putting #include "core/variant.h" above #include "core/io/json.h" It worked for me. |
Well, that serves as a workaround, but the rules about include paths should be consistent across the whole codebase. We have to find an universal solution; I mean, it might be inserting full paths like that in every |
Perhaps a better solution for this would be to change the |
@Tyler-Yocolano, sorry, I misread you. I thought you were suggesting the same @marcelofg55 has said now. |
I agree that more absolute paths should be used everywhere. I never even considered this kind of problem because it's hidden in The sad thing is that it would work just fine if I'll make a PR to fix this in GDNative, but I think in the long run we should use less ambiguous paths. |
fixes godotengine#10071. The problem is that the json.h file includes the local variant.h instead of the "absolute" core/variant.h
So as to not revive godotengine#10071, as suggested by @akien-mga.
core/ and core/math have been in the default include path, this can cause trouble when a direction has files with the same basename as files in core/ or core/math. (see godotengine#10071) In order to fix such future problems all core/... includes need to be explicit, preventing the compiler *not* including core files when files with same basename are present.
Godot 3.0 fails to compile with MSVC because of its rules for searching include files. Specifically, when compiling
modules\gdnative\godot\dictionary.cpp
you get this error:The problem is that although you'd expect
#include "variant.h"
incore/io/json.h
to includecore/variant.h
, since MSVC doesn't find it right wherejson.h
is, it looks for it according to this:That is, it seems to go up in the include chain until it reaches the directory of the main file being compiled (
modules/gdnative/godot
), which happens to contain avariant.h
file itself, and that is taken.I'm not sure how to deal with this. Happens at least with MSVC 2017.
@vnen, have you seen this issue? Any ideas on how to fix?
The text was updated successfully, but these errors were encountered: