Advertisement Jump to content
Sign in to follow this  
MatthewMalice

compiling AngelScript - error!

This topic is 1752 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

First - Hi! It's my first post in here! :)

I am trying to compile a project named opendungeons. They've got some dependencies, and they use cmake. I executed cmake, and now I'm trying to use make, but I am encountering an error:

 

http://pastebin.com/j5sbQVmt

 

Any ideas what may be causing this problem?

Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement

You didn't post the error you're encountering.

 

I'm just seeing the commandline for compiling the the file po_parser.cpp from tinygettext. The commandline itself seems to be OK.

 

What is the error you're getting?

Share this post


Link to post
Share on other sites

Ah, it looks like the OpenDungeons managers haven't upgraded the AngelScript version they are using for a while.

 

This compilation error is specific to the g++ 4.7+ compiler and version. In a more recent version of AngelScript I've solved it by implementing a wrapper for the std::string::operator==. Like this:

 

// String equality comparison.
// Returns true iff lhs is equal to rhs.
//
// For some reason gcc 4.7 has difficulties resolving the
// asFUNCTIONPR(operator==, (const string &, const string &)
// makro, so this wrapper was introduced as work around.
static bool StringEquals(const std::string& lhs, const std::string& rhs)
{
    return lhs == rhs;
}
 
void RegisterStdString_Native(asIScriptEngine *engine)
{
   ...
 
   // Need to use a wrapper for operator== otherwise gcc 4.7 fails to compile
   r = engine->RegisterObjectMethod("string", "bool opEquals(const string &in) const", asFUNCTIONPR(StringEquals, (const string &, const string &), bool), asCALL_CDECL_OBJFIRST); assert( r >= 0 );
 
   ...
}

Share this post


Link to post
Share on other sites

Yes, 4.8.2 has the same STL implementation as 4.7 so you'll definitely need the update in scriptstdstring.cpp that I mentioned above.

 

Note, this is not a bug in g++. It's just that with 4.7 they changed their STL implementation, previously the operator== was a global function as it is on other compilers, but with 4.7 they changed it to be an member operator, which is why the asFUNCTIONPR macro stopped working.

 

Talk to the OpenDungeons managers to update the scriptstdstring.cpp with the above fix (or even update the entire angelscript library), and you should be good to go.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!