Symbian
Symbian OS Library

FAQ-0913 I get unresolved symbols at link time for functions that are not in my code. How do I fix them?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Development
Created: 08/05/2003 Modified: 09/12/2003
Number: FAQ-0913
Platform: Not Applicable

Question:
When I compile my project I get unresolved link errors for symbols like __umodsi3, __udivsi3, __mulsf3 and others. The functions are not in my code, and yet gcc seems to need them. Where are these functions coming from?

Answer:
    GCC targets many different machine instruction sets and on some systems has to provide functions that implement certain C and C++ language features (e.g. floating point arithmetic) that are not in the native instruction set.

    The set of functions it may use are in the files:

    src\gcc\libgcc1.c
    src\gcc\libgcc2.c

    (The source for gcc can be found at http://www.symbian.com/developer/downloads/tools.html)

    Not all will be needed on any given system. Symbian OS supplies implementations of the most commonly used functions in euser.dll and egcc.lib.

    egcc.lib was introduced in version 6.0, and includes two functions from libgcc2.c:

    __fixunsdfsi // Convert double to unsigned int
    __fixunssfsi // Convert float to unsigned int

    For 6.0, it was necessary to add the line:

    STATICLIBRARY egcc.lib

    to your mmp file in order to use these functions. From 6.1 onwards, this has been added automatically to any project that needs it.

    All of the other commonly used functions that gcc requires are implemented in euser.dll, and for the particular version of Symbian OS that you have,
    you can determine the set of functions provided by looking in \epoc32\release\[ARMI|THUMB|ARM4]\urel\euser.dll.map.

    If the function your code needs is not available, you can implement it yourself in terms of standard Symbian OS functions. For example, some of the
    64-bit helper functions mentioned in the title could be implemented using the TInt64 class. You can consult the reference implementations in libgcc1.c
    and libgcc2.c to understand what the function must do.


    Note that in some gcc configurations, these functions are made available in libgcc.o. This library is not available on Symbian OS, with the functions
    (that are implemented by Symbian) being supplied in euser.dll and egcc.lib instead.