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

Fix building with gcc on Linux #3180

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

Hiradur
Copy link
Contributor

@Hiradur Hiradur commented Sep 22, 2024

Hi guys,

good to see that RoR is still alive. :)

I'm trying to build RoR on Debian 12 with gcc (Debian 12.2.0-14) 12.2.0 but ran into some compiler errors.

This PR fixes some of them, however the following errors do still remain and I am unsure how to fix them:

ninja | grep error
/home/deb/rigs-of-rods/source/main/scripting/bindings/OgreAngelscript.cpp:1647:86: error: invalid ‘static_cast’ from type ‘Ogre::SceneNode* (Ogre::SceneNode::*)() const’ to type ‘Ogre::SceneNode* (Ogre::SceneNode::*)()’
/home/deb/rigs-of-rods/source/main/scripting/bindings/OgreAngelscript.cpp:1648:90: error: invalid ‘static_cast’ from type ‘const Ogre::Vector3& (Ogre::SceneNode::*)() const’ {aka ‘const Ogre::Vector<3, float>& (Ogre::SceneNode::*)() const’} to type ‘const Ogre::Vector3& (Ogre::SceneNode::*)()’ {aka ‘const Ogre::Vector<3, float>& (Ogre::SceneNode::*)()’}
/home/deb/rigs-of-rods/source/main/scripting/bindings/OgreAngelscript.cpp:1649:98: error: invalid ‘static_cast’ from type ‘const Ogre::Vector3& (Ogre::SceneNode::*)() const’ {aka ‘const Ogre::Vector<3, float>& (Ogre::SceneNode::*)() const’} to type ‘const Ogre::Vector3& (Ogre::SceneNode::*)()’ {aka ‘const Ogre::Vector<3, float>& (Ogre::SceneNode::*)()’}
/home/deb/rigs-of-rods/source/main/scripting/bindings/OgreAngelscript.cpp:1651:97: error: invalid ‘static_cast’ from type ‘void (Ogre::SceneNode::*)(bool, bool) const’ to type ‘void (Ogre::SceneNode::*)(bool, bool)’
/home/deb/rigs-of-rods/source/main/scripting/bindings/OgreAngelscript.cpp:1652:87: error: invalid ‘static_cast’ from type ‘void (Ogre::SceneNode::*)(bool) const’ to type ‘void (Ogre::SceneNode::*)(bool)’
/home/deb/rigs-of-rods/source/main/scripting/bindings/OgreAngelscript.cpp:1653:109: error: invalid ‘static_cast’ from type ‘void (Ogre::SceneNode::*)(bool, bool) const’ to type ‘void (Ogre::SceneNode::*)(bool, bool)’

gcc requires this due to how the struct is initialized in AddonPartFileFormat.cpp
@ohlidalp
Copy link
Member

@Hiradur Good to see you're alive, too!

Those errors are all ~~~ const issue in some AngelScript wrappers. I'll see if I can convince Visual Studio to recognize those too, but I should be able to fix them either way.

@ohlidalp
Copy link
Member

ohlidalp commented Sep 23, 2024

Dang, those happen within the asMETHODPR() macro from AngelScript SDK. I checked the const qualifiers but they're correct. I cranked up VisualStudio warning level to maximum, but this didn't hit it. I'm binding several other OGRE classes the same way and none has a problem.

For the time being just comment those out, nobody uses them anyway.

@Hiradur
Copy link
Contributor Author

Hiradur commented Sep 23, 2024

Thanks for the quick response and sorry for wasting your time. I realized I had libogre-1.12-dev installed to the system directories and also ogre from ror-dependencies. After uninstalling libogre-1.12-dev and rebuilding ror-dependencies, the errors disappeared.
The other changes are still necessary though, I double checked them. With these I could successfully build and run RoR.

From my point of view, the PR is ready for review.

Copy link
Member

@ohlidalp ohlidalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are minor and build OK on VisualStudio, too.

@ohlidalp ohlidalp merged commit e91f4d6 into RigsOfRods:master Sep 26, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants