Skip to content
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

SOL_BASE_CLASSES / SOL_DERIVED_CLASSES should be mentioned in the documentation #1597

Open
Maddimax opened this issue Apr 15, 2024 · 0 comments

Comments

@Maddimax
Copy link
Contributor

I'm having the following project structure:

exe
  => lua-5.4.6 (static .lib)
  => lua-base (dynamic .dll) -> Includes sol and defines a bunch of usertypes with base/derived classes
      => class A;
      => class B : A;
  => SomePlugin (dynamic .dll) -> Provides some additional functions via sol (also includes sol.hpp), and uses the usertypes from lua-base

If "SomePlugin" now tries to call table.get<A>("example"), and in lua we did myTable["example"] = B::create(), the call of .get<A>(...)will fail as the check whether A is derived from B always fails.

As a workaround, adding SOL_DERIVED_CLASSES(A, B) and including that in "SomePlugin"'s code will fix the issue.

Therefore it would be great to mention this in the documentation, as finding it on your own is non-trivial :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant