Professional Web Applications Themes

ld error - Mac Programming

Hi, I would build a little unix application on macosx, but I become a little error message. gcc video.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc audio.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc wrapper.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc media.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc state.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc events.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc display.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include gcc boulderdash.c -o boulderdash -Wall -L/usr/local/lib -L/usr/X11R6/lib -lSDL -lGL -lGLU -lglut -lSDL_mixer display.o wrapper.o video.o audio.o media.o events.o state.o -I/usr/local/include -I/usr/include -I/usr/X11R6/include boulderdash.h:40: warning: `TextureImages' defined but not used boulderdash.h:42: warning: `SoundFiles' defined but not used boulderdash.h:44: warning: `LevelFiles' defined but ...

  1. #1

    Default ld error

    Hi,

    I would build a little unix application on macosx, but I become a
    little error message.

    gcc video.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
    gcc audio.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
    gcc wrapper.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
    gcc media.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
    gcc state.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
    gcc events.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
    gcc display.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
    gcc boulderdash.c -o boulderdash -Wall -L/usr/local/lib
    -L/usr/X11R6/lib -lSDL -lGL -lGLU -lglut -lSDL_mixer display.o
    wrapper.o video.o audio.o media.o events.o state.o -I/usr/local/include
    -I/usr/include -I/usr/X11R6/include
    boulderdash.h:40: warning: `TextureImages' defined but not used
    boulderdash.h:42: warning: `SoundFiles' defined but not used
    boulderdash.h:44: warning: `LevelFiles' defined but not used
    ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in
    indirectly referenced dynamic library /usr/lib/libobjc.A.dylib
    make: *** [boulderdash] Error 1


    What is my problem, please ? It's a X11 application, I don't use objective-c.

    -Jens

    Jens Guest

  2. #2

    Default Re: ld error

    In article <c18c4o$5l0$01$t-online.com>,
    Jens Frederich <com> wrote:
     
     

    It's using OpenGL, which on Mac OS X unfortunately also requires that
    you explictly link against the Objective-C runtime. Add '-lobjc' to the
    appropriate spot in the line that's building boulderdash.c and it should
    work.

    Hope this helps,
    Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  3. #3

    Default Re: ld error

    On 2004-02-22 02:14:40 +0100, Eric Albert <stanford.edu> said:
     

    >
    > It's using OpenGL, which on Mac OS X unfortunately also requires that
    > you explictly link against the Objective-C runtime. Add '-lobjc' to
    > the appropriate spot in the line that's building boulderdash.c and it
    > should work.
    >
    > Hope this helps,
    > Eric[/ref]

    Okay, I've understand, but I would use the X11 OpenGL(/usr/X11R6/) not
    the OpenGL Framework.
    What must I change to use this?

    -Jens

    Jens Guest

  4. #4

    Default Re: ld error

    In article <c19rpi$s01$05$t-online.com>,
    Jens Frederich <com> wrote:
     
    > > 
    > >
    > > It's using OpenGL, which on Mac OS X unfortunately also requires that
    > > you explictly link against the Objective-C runtime. Add '-lobjc' to
    > > the appropriate spot in the line that's building boulderdash.c and it
    > > should work.[/ref][/ref]
     

    There is no separate X11 OpenGL. There's just one OpenGL framework on
    the system, and X11 uses that. You'll need the '-lobjc' either way. :(

    -Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  5. #5

    Default Re: ld error

    On 2004-02-23 00:27:06 +0100, Eric Albert <stanford.edu> said:
     [/ref]

    >
    > There is no separate X11 OpenGL. There's just one OpenGL framework on
    > the system, and X11 uses that. You'll need the '-lobjc' either way. :(
    >
    > -Eric[/ref]

    bull, under /usr/X11R6/lib is a own version from OpenGL ..... this
    is not a link to the framework and when I add the -lobjc option I
    become this error
    ld: Undefined symbols:
    _main
    make: *** [boulderdash] Error 1

    so a ... I've a main function. This is funny

    Jens

    Jens Guest

  6. #6

    Default Re: ld error

    In article <c1dptj$q47$02$t-online.com>,
    Jens Frederich <com> wrote:
     
    > > 
    > >
    > > There is no separate X11 OpenGL. There's just one OpenGL framework on
    > > the system, and X11 uses that. You'll need the '-lobjc' either way. :([/ref][/ref]
     

    If you use otool -L on that library, you'll see that it links against
    the OpenGL framework.
     

    Yep; you're missing main().

    -Eric

    --
    Eric Albert stanford.edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

Similar Threads

  1. Error Message "A drawing error ocurrred which is probably due to an out-of-memory condition. Try qu
    By wendy_matarazzo@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: May 11th, 06:12 PM
  2. Replies: 0
    Last Post: March 29th, 09:49 PM
  3. Replies: 0
    Last Post: November 10th, 05:24 PM
  4. Replies: 1
    Last Post: August 7th, 07:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139