Cross platform software development

Can be a real pain!
Ryzom Core Studio is a cross platform tool, the entire point of creating it was to move away and get free of the shackles of Windows as the old Ryzom tools were written with MFC.
Unfortunately two of it’s plugins kept triggering an assert when loaded together.

As it turns out the source of the problem was that GCC and Visual Studio link libraries differently:
Ryzom is built on Nel the Nevrax libraries. One of these libraries is the LIGO library, which is basically a data library. Also Nel uses a quite powerful (de)serialization system which is based on an abstract object factory, which is implemented using static methods and static member variables. What’s also important that these Nel libraries are linked statically right now.

Unfortunately as it turns out it behaves differently depending on which compiler built it: GCC or Visual Studio.
When building with Visual Studio each plugin gets it’s own instance of the static variables, while with GCC they share the same one.
So when the LIGO library is started up, it registers it’s classes. When the first plugin that uses it loads there’s no problem, but with the second an assert is triggered because those classes have already been registered.
In this case solving this problem was fairly simple: Since those plugins use their own LIGO configs ( a context object of sorts ), guarding against multiple registrations was enough.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: