Closed madmongo1 closed 7 months ago
@madmongo1 , thanks for the issue!
I am unable to reproduce it, though. I have tried this with GCC and clang and in both cases it compiles without issues and produces the following output:
{"a":"Hello, World!","b":100}
Two possible reasons I can think of:
1) Are you trying to compile this with MSVC? MSVC is not yet supported (as we state in the README). However, I will add support for MSVC this weekend.
2) I can see that there is an undefined reference to rfl::internal::fake_object<iron::foo>
, but your minimal example does not contain anything called iron
. One limitation is that the struct cannot be declared inside a function (which is my bad...I haven't documented this limitation yet). Is iron
a function?
@madmongo1 , thanks to the input of @ecatmur, I was able to reproduce the issue and implement a fix (https://github.com/getml/reflect-cpp/commit/2e3872c651dc5c0a2c06fa4f0b094617c74fc8bd).
Can you confirm that this fixes your issue?
If no, can you provide the compiler used (including the version number) and the compiler flags used?
Given this program:
How do I fix this error?
The program is linked with target
reflectcpp_static
.Thank you.