Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

SqPlus linking error only with optimization turned on (GCC)

Last post 01-20-2010, 3:40 AM by AndiNo. 0 replies.
Sort Posts: Previous Next
  •  01-20-2010, 3:40 AM 3620

    SqPlus linking error only with optimization turned on (GCC)

    Hi! I found ways to circumvent many Squirrel and SqPlus problems until now when I tried to compile my program in release mode (which has optimization turned on). There is one specific code line that gives me an undefined reference during the linking process. This ONLY happens if I have any optimization turned on (O, O1, O2, using GCC). Here's the line which causes the error:

    SquirrelObject vec( Vector3(x,y,z) );

    And that's the error:

    )]+0x1a)    undefined reference to `void SqPlus::Push<Ogre::Vector3>(SQVM*, Ogre::Vector3&)'

    I have defined the Vector3 class:
    DECLARE_INSTANCE_TYPE_NAME (Ogre::Vector3, Vector3);
    and register it, too:
    SQClassDef <Ogre::Vector3> ("Vector3")
    ...

    The funny thing is that it compiles flawlessly without optimization. Does anyone have an idea what I can do about this (except disabling optimization)?
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems