-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Can't build samples on Visual Studio 2015 #699
Comments
Hm, it looks like examples are building in CI: Thinking about what could cause this, are you compiling code as C++11 (or higher)? |
This error:
does look like something you'd get when you're trying to compile a v3 example (like the one posted) with the v2 API, can you confirm you're using the v3 library? |
Hm, are you sure sure? :p Looking at the error message:
In v3 flecs.hpp is just a file that includes the rest of the C++ API, and only has 144 lines. The entity builder code is here: https://github.com/SanderMertens/flecs/blob/master/include/flecs/addons/cpp/mixins/entity/builder.hpp |
My bad! I mixed the configurations in the configuration manager. These are the errors I was getting in the first place before mixing configurations :
|
The errors are a bit obtuse, but what I think is happening is that vs2015 has a different format for The enum reflection code uses that macro + a function that accepts the enum value as a template parameter to figure out the name of the constant at compile time. There is a bit of (ugly but it works) trickery to figure out from that string whether value is a valid constant for the enumeration. If this is what is happening (I can't validate yet, don't have a vs2015 environment setup) I'd have to special case that version of msvc with whatever format it uses for If you'd like to take a crack at it let me know & I can point you to the right code. Alternatively you could also remove the |
Hi, I created a test to compare this macros and others between Visual Studio 2015 and 2019.
I also tried to remove the enum header and its references, but I'm now getting this error:
Any other idea? Thank you! |
Have there ever been any new discoveries on this issue? I'm currently trying to evaluate flecs for a work-related project, and VS 2015 is the newest version usable by us right now. I'm running into the same issues as mentioned in #699 (comment). Removing the enum.hpp header didn't resolve them. I tried using the C API instead of the C++ API, but that didn't work, since it's written in a way that makes it only compile from native C code, not C++. I even switched back to an old 2.x version of flecs to see if I'd get any further with that, but it pretty much just led to a different set of template-related errors. So currently, I think I'm pretty much out of options for stuff I could try, at least until we are able to work with a newer VS version. |
@RPGHacker I added a new #define FLECS_CPP_ENUM_REFLECTION_SUPPORT 0
You should be able to use the C API from C++ (the C++ API is written using the C API). Some shorthand macro's (e.g. |
The library compiles properly with Visual Studio 2015, but simple samples like examples/cpp/hello_world/src/main.cpp won't compile with vs2015.
The code:
The compiler errors:
Steps to reproduce the behavior
Expected behavior
All the samples should compile on visual studio 2015
Notes
The text was updated successfully, but these errors were encountered: