sol2 icon indicating copy to clipboard operation
sol2 copied to clipboard

Compile Errors with Xcode 16

Open TheSevenSages opened this issue 1 year ago • 9 comments

I've been working on a project using Sol over the last few months. I use Xcode to create my Mac builds and bug test on Mac OS devices. This morning I updated my version of Mac OS to OS 15 and Xcode to version 16.0. Then I started getting this compiler error:

Address of overloaded function 'call' does not match required type 'int (lua_State *)'

When attempting to fix this problem myself I found that commenting out all of the sections where I add userdata to the Lua state the project compiles just fine.

// Collision Class LuaAPI::GetLuaState()->new_usertype<Collision>("Collision", "other_actor_id", &Collision::other_actor_id, "this_actor_id", &Collision::this_actor_id, "point", &Collision::point, "relative_velocity", &Collision::relative_velocity, "normal", &Collision::normal );

I was not getting this error before I upgrades my OS version and Xcode, any insight into why this problem is occurring would be a massive help.

I should also probably mention that I'm on a M1 Macbook Pro, and that I've tried the tricks from the other posts related to this issue, and commenting out those noexcept function calls did not fix the issue.

The windows build works just fine so I'm confident that this is related to the OS and Xcode upgrade. I'm pretty stumped on this one so any help is appreciated.

TheSevenSages avatar Oct 05 '24 22:10 TheSevenSages

Duplicate of #1581

checkraisefold avatar Oct 06 '24 07:10 checkraisefold

Duplicate of #1581

I attempted the fixes proposed in that thread and they simply didn't work for me. So I figured a more specific post was more appropriate.

TheSevenSages avatar Oct 06 '24 20:10 TheSevenSages

I ended up downgrading my version of Xcode back to 15.4 using the guide here, but this will definitely cause problems for building on Mac in the future, so I'm leaving this thread up.

TheSevenSages avatar Oct 07 '24 03:10 TheSevenSages

By the way, my repo is: https://github.com/reidcam/Wolverine-Engine if anyone here wants to try and fix this issue

TheSevenSages avatar Oct 09 '24 17:10 TheSevenSages

Not sure about the response, but I did open this ticket : https://forums.developer.apple.com/forums/thread/766303

Erwsaym avatar Oct 15 '24 20:10 Erwsaym

@Erwsaym has there been any response on the internal (?) ticket? I think it's not public.

FireflyInTheDusk avatar Nov 05 '24 08:11 FireflyInTheDusk

@Erwsaym bumping the above message, thanks for submitting the ticket! I can't see any updates on the ticket I think it's private?

TheSevenSages avatar Jan 05 '25 21:01 TheSevenSages

Hey, sorry for the response time.

No they didn't respond to the ticket. I figured it out how to bypass the problem by the way. I installed clang (v16.0.0 which is compatible for all my libraries) via brew packet manager and using it instead of apple-clang

Indeed the ticket seems internal and I can't do anything on it... It is in "Pending" state

Erwsaym avatar Jan 05 '25 22:01 Erwsaym

Hey, the problem seems resolved since Xcode 16.3. I tried this evening with 16.4 version using CLT and it seems okay.

(using this commit : ‘d805d02‘ due to this issue : https://github.com/ThePhD/sol2/issues/1695)

Erwsaym avatar Jun 03 '25 21:06 Erwsaym

Thank you!

TheSevenSages avatar Jul 31 '25 15:07 TheSevenSages