Undefined symbols when compiling with toolchain

Discussion in 'iOS Development' started by pinhassi, Jan 11, 2009.

  1. pinhassi

    pinhassi New Member

    Joined:
    Jan 11, 2009
    Messages:
    6
    Likes Received:
    0
    Hi,
    I built arm-apple-darwin-gcc with this tutorial.

    I was able to compile and install a simple "Hello world" application,
    but when I try to compile something more complex (c++, some external libraries), I get "Undefined symbols" error for the following symbols:

    ___muldf3vfp,
    ___fixdfsivfp,
    ___fixsfsivfp,
    __Unwind_SjLj_Resume,
    __Unwind_SjLj_Unregister,
    __Unwind_SjLj_Register,
    ___floatsisfvfp

    Does anyone knows what are these symbols or where can I find their definitions?


    My Makefile and the full error log are attached.

    Thanks,
    Asaf.

    Attached Files:

  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    /Volumes/Data/Workspace/EatThis/AntCore/code ? Interesting...



    So, you're making libraries? If not, then your makefile is substantially more than you need. It probably still it if you are. But hey, there is absolutely nothing wrong with that.

    The error that you have is that whichever library/libraries that include those symbols either aren't present in your build environment, or aren't linked to. the first step would be to find out to which libraries those symbols belong. Just google, it should be simple enough.

    If you're missing one or more libraries, look for them on Cydia. Assuming they exist, download them. Make sure to tell whomever hosts your package on their repository that your application requires those packages, and that they need to add dependencies.

    If the libraries are nonexistent within Cydia, you will need to download the source code for the library and compile it yourself. You have two choices what to do next. You can include the libraries within your app's bundle and have it installed alongside the application. The better option would be to release the library as a separate package, and require it as a dependency. The benefits are that the library and app can be updated separately, and other developers can also use and link to that library.

    Also, review your error list. I only skimmed through, and I skipped large parts, but it is full of warnings. For example, "warning: command line option "-std=c99" is valid for C/ObjC but not for C++."

    Good luck, and have fun!
  3. pinhassi

    pinhassi New Member

    Joined:
    Jan 11, 2009
    Messages:
    6
    Likes Received:
    0
    First, thanks for the quick reply!

    I know that the problem is probably missing libraries, only I don't know which...

    I tried to googlize it but I couldn't get more information.

    My guess is that these libraries are related either to the iPhone file system, which I downloaded according to the following manual or to the llvm I'm using which is not the most recent release (I use release 42498 as suggested in the manual).


    Any idea ???
  4. pinhassi

    pinhassi New Member

    Joined:
    Jan 11, 2009
    Messages:
    6
    Likes Received:
    0
    Problem solved.
    The problem was linking libgcc_eh.a
    To solve this, use:
    LIBFLAGS += -L"/usr/local/arm-apple-darwin/lib"
    instead of:
    LIBFLAGS += -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib

    I created the toolchain env using this tutorial:
    http://ansani.it/2008/08/12/build-the-toolchain-for-iphone-20x-on-macosx-105x/

    I attached a working application (an example I found on the net) and a makefile.


    Goodluck for anyone who experiences it in the future,
    Asaf Pinhassi
  5. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Oh yeah, wow. That guide uses out of date headers, and you'll be lucky if your app doesn't throw you a crap ton of errors and warnings all the time. You should have used this guide: http://www.saurik.com/id/4

Share This Page