Re: ld error trying to compile Motif Application - Motif

This is a discussion on Re: ld error trying to compile Motif Application - Motif ; Aaron Hsu wrote: > The last command, of course, gave an error, but the other two commands > gave me the following: > > /usr/bin/ld: Undefined symbols: > _XtAddCallback > _XtAppMainLoop > _XtManageChild > _XtRealizeWidget > _XtSetLanguageProc > _XtVaOpenApplication > ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: ld error trying to compile Motif Application

  1. Re: ld error trying to compile Motif Application

    Aaron Hsu wrote:

    > The last command, of course, gave an error, but the other two commands
    > gave me the following:
    >
    > /usr/bin/ld: Undefined symbols:
    > _XtAddCallback
    > _XtAppMainLoop
    > _XtManageChild
    > _XtRealizeWidget
    > _XtSetLanguageProc
    > _XtVaOpenApplication
    > _sessionShellWidgetClass


    Motif requires linking against libXt and libX11. On some systems with
    transitive dynamic dependencies, you don't need to manually specify
    this. But you will need to make sure they are installed!

  2. Re: ld error trying to compile Motif Application

    On Tue, 24 Oct 2006 12:30:34 -0500, Aaron Hsu
    wrote:

    >In article <27r%g.4496$rx.623@trnddc04>, ST wrote:
    >
    >> Aaron Hsu wrote:
    >>
    >> > The last command, of course, gave an error, but the other two commands
    >> > gave me the following:
    >> >
    >> > /usr/bin/ld: Undefined symbols:
    >> > _XtAddCallback
    >> > _XtAppMainLoop
    >> > _XtManageChild
    >> > _XtRealizeWidget
    >> > _XtSetLanguageProc
    >> > _XtVaOpenApplication
    >> > _sessionShellWidgetClass

    >>
    >> Motif requires linking against libXt and libX11. On some systems with
    >> transitive dynamic dependencies, you don't need to manually specify
    >> this. But you will need to make sure they are installed!

    >
    >Hm, I am trying to test the possibility of development using Xcode and
    >through the command line. Here's what I got:
    >
    >$ gcc -I/usr/OpeMotif/include -L/usr/OpenMotif/lib -L/usr/X11R6/lib -lXm
    >-lXt main.c
    >
    >WORKS!
    >
    >However, I can't seem to get it working through Xcode, and I can't seem
    >to find the variable I need to change to make the search paths
    >automatic.


    That will be specific to Xcode. There is no general solution.

    >I read that LD_LIBRARY_PATH ought to have eliminated the need
    >to use the -L options, but that doesn't work. :-) What am I missing here?


    LD_LIBRARY_PATH only concerns *running* the executable; it is used
    when some library to which you have linked, is installed in some other
    place than the usual (which commonly are /lib and /usr/lib, but that
    is very much platform-dependent).

    As you already know, -I is used to set the search path for headers,
    and -L the search path for libraries at *link* time. You still have to
    use -l to tell the linker *which* libraries, that's not automatic.

    >
    >- Aaron Hsu


+ Reply to Thread