Giter VIP home page Giter VIP logo

Comments (5)

demonixis avatar demonixis commented on July 1, 2024 1

In that case, I'll prepare a PR with macos support. Linux support is still on its way because I've some error with the linking process. It's related to Unreal and not JSBSim. I don't know why, but linking the static lib on macos works well. On Linux, the static or dynamic cause linking issue. I've to investigate.

from jsbsim.

demonixis avatar demonixis commented on July 1, 2024

I fixed many problems on my branch now the problem is about the typeid keyword that breaks the compilation on Linux and Mac. It's not possible to easilly add rtti without rebuilding the game engine itself.
A quick fix to validate that the plugin can compile on mac/linux is to hack the prop.hxx file like this

static const char* name() { return ""; }// typeid(T).name(); }

But it's not good... So I'm asking for help to find a way to replace typeid OR make it work with Unreal.

from jsbsim.

seanmcleod avatar seanmcleod commented on July 1, 2024

So are you saying that the Unreal engine on Windows is built with rtti enabled but not by default on Mac and Linux?

from jsbsim.

demonixis avatar demonixis commented on July 1, 2024

Well I'm not sure but it doesn't compile on Linux and macOS. However with the "hack" it compiles fine... I was able to run launch the Unreal project on macOS and I'll try on Linux too later today.

I suppose that there is no easy workaround and returning an empty string is not a good solution right?

Capture d’écran 2023-03-29 à 18 14 36

JSBSim Unreal on macOS ;)

from jsbsim.

bcoconni avatar bcoconni commented on July 1, 2024

@demonixis, actually you can safely delete the code lines 1881-1929 in src/simgear/props/props.hxx, these are unused by JSBSim.

namespace simgear
{
/**
* Default trait for extracting enum values from SGPropertyNode. Create your
* own specialization for specific enum types to enable validation of values.
*/
template<class T>
struct enum_traits
{
/**
* Typename of the enum
*/
static const char* name() { return typeid(T).name(); }
/**
* @return Default value (will be used if validation fails)
*/
static T defVal() { return T(); }
/**
* @return Whether the given integer value has an enum value defined
*/
static bool validate(int) { return true; }
};
} // namespace simgear
/** Extract enum from SGPropertyNode */
template<typename T>
#if PROPS_STANDALONE
inline T
#else
inline typename boost::enable_if<boost::is_enum<T>, T>::type
#endif
getValue(const SGPropertyNode* node)
{
typedef simgear::enum_traits<T> Traits;
int val = node->getIntValue();
if( !Traits::validate(val) )
{
SG_LOG
(
SG_GENERAL,
SG_WARN,
"Invalid value for enum (" << Traits::name() << ", val = " << val << ")"
);
return Traits::defVal();
}
return static_cast<T>(node->getIntValue());
}

Once you're happy with your code (including deleting the lines mentioned above), you can submit a PR.

from jsbsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.