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

Building on Windows #1

Open
lucasvinbr opened this issue May 13, 2023 · 3 comments
Open

Building on Windows #1

lucasvinbr opened this issue May 13, 2023 · 3 comments

Comments

@lucasvinbr
Copy link

After setting up the symlinks, I've successfully built and run the project on Linux, but I've run into some issues when building with visual studio on Windows:

  • I get this C1128 error when compiling BindFunctions_Urho3d.cpp , but adding the /bigobj command line argument solves it. Would it be necessary to break the generated file into multiple ones in this case?
  • I had to add a #ifdef SendMessage #undef SendMessage #endif to the BindConnection.cpp file, just like in Urho's Connection.cpp file, because apparently Windows has that define overriding things. It could be added via the binding generator, right?
  • After solving the points above, I'm getting multiple messages No constructor could take the source type, or constructor overload resolution was ambiguous in some files, followed by C2440 errors in those same files and lines.
    -- The error message in all of them is can't convert from "unkown" to "sol::this_state".
    -- Here's my build log; it's in portuguese, but the line numbers are there, so maybe it could help: build-out.txt .
    -- The one pattern I've noticed is that the overloads the compiler complained about seem to be the ones that have parameters with default values for them, like Node's CreateChild with CreateMode mode = REPLICATED

Thanks!

@SirNate0
Copy link
Owner

SirNate0 commented May 14, 2023

Thank you for attempting to build it for Windows.

  1. It seems to me that just enabling /bigobj might be better. I believe Microsoft does the same for UWP apps because their template heavy code also exceeds the limit.
  2. Yes, it can be added to the binding generator.
  3. I think your final point is probably the answer, though I've only looked at a single function. I believe the issue comes down to this line (below), though the error message isn't very clear and points to the end of the lambda instead of the beginning. I think it's probably because there is a default argument before the sol::this_state argument (that has no default). Possibly the presence of the default argument at all. In any case, I think removing the default arguments should be doable and advisable.

[](Urho3D::CustomGeometry& self, unsigned index=0, sol::this_state sol_state)->sol::object{

@lucasvinbr
Copy link
Author

Alright, I've finally got it to build on Windows! I removed the default arguments, added /bigobj, and then had to add skipping of members with no name, because BindShaderParameter was being generated with 2 empty member variables (I think it was because of the "union" keyword being used there?). Would it be interesting to add these changes as a PR?

@SirNate0
Copy link
Owner

I'd appreciate that, please do.

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

2 participants