what is the "right" link order ? - Motif

This is a discussion on what is the "right" link order ? - Motif ; Group, what is the "right" order to link in X11 libs? I'm using -lXt -lXm -lXext -lX11 -lIM -lSM -lICE -lXi -li18n and get a BadColor (invalid Colormap parameter) error, opcode 13 (X_QueryColor), serial no. 13. When I swap -Xm ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: what is the "right" link order ?

  1. what is the "right" link order ?

    Group,

    what is the "right" order to link in X11 libs?

    I'm using
    -lXt -lXm -lXext -lX11 -lIM -lSM -lICE -lXi -li18n

    and get a

    BadColor (invalid Colormap parameter) error, opcode 13 (X_QueryColor),
    serial no. 13.

    When I swap -Xm and -Xt, I get much earlier in the code a

    BadMatch (invalid parameter attributes) error, opcode 1 (X_CreateWindow),
    serial no. 68.


    I'm on AIX5, using exceed X server.

    thx a bunch,
    H.




  2. Re: what is the "right" link order ?

    "Hans Horn" wrote in news:qbbcd.31378$QJ3.30308
    @newssvr21.news.prodigy.com:
    > what is the "right" order to link in X11 libs?
    >
    > I'm using
    > -lXt -lXm -lXext -lX11 -lIM -lSM -lICE -lXi -li18n


    Xm before Xt. My web site has a copy of the Motif FAQ.

    Ken Lee, http://www.rahul.net/kenton/

  3. Re: what is the "right" link order ?

    Thanks for pointing the Xm, Xt order out.


    This is the order of the libs are they are now linked (forget to mention
    that I'm also using motiftools, xmt v40).
    ....
    (ld): lib /usr/lib/libm.a
    (ld): lib /usr/lib/libl.a
    (ld): lib /usr/lib/liby.a
    (ld): lib /archive/home/Mulliken/src/gui/Xmt400/pwr4/libXmt_g.a
    (ld): lib /usr/lib/libXm.a
    (ld): lib /usr/lib/libXt.a
    (ld): lib /usr/lib/libX11.a
    (ld): lib /usr/lib/libXext.a
    (ld): lib /usr/lib/libICE.a
    (ld): lib /usr/lib/libXi.a
    (ld): lib /usr/lib/libIM.a
    (ld): lib /usr/lib/libSM.a
    (ld): lib /usr/lib/libi18n.a
    (ld): lib /usr/lib/libiconv.a
    (ld): lib /usr/lib/libcrypt.a
    (ld): lib /usr/lib/threads/libxlf90.a
    (ld): lib /usr/lib/libg.a
    (ld): lib /usr/lib/libxlopt.a
    (ld): lib /usr/lib/libpthreads.a
    (ld): lib /usr/lib/threads/libc.a

    On a Truecolor screen, I get with these libs:

    X Error of failed request: BadMatch (invalid parameter attributes)
    Major opcode of failed request: 1 (X_CreateWindow)
    Serial number of failed request: 69
    Current serial number in output stream: 75

    However, on a 256 color screen, everything behaves.


    This is I'm trying to do here: For a legacy gui (coded with extenive use of
    xmt) that works only with 256 colors, I'm trying (using what's described in
    http://www.faqs.org/faqs/Xt-FAQ/section-5.html) to programmatically change
    colordepth and visual, so I can run the gui on a TrueColor display.

    The example from the above link compiles and links ootb, and appears to be
    functioning properly.
    Its linklibs are like this: -lXaw -lXmu -lXt -lXext -lX11 -lm.


    In the initialization section of the gui I'm using the essential bits from
    the example and am getting the BadMatch error above (on a TrueColor
    display), or no error (on a 256 color display).


    After some experimenting, I found that if I add -lXm to the examples'
    linklibs (such as : -lXaw -lXmu -lXm -lXt -lXext -lX11 -lm), I'm able to
    duplicate these findings : BadMatch error (on a TrueColor display), no error
    (on a 256 color display).


    Could it be that what I'm trying is not possible, or are there some
    unfortunate clashes between some of the libraries?
    Or may be I doing something really stupid?
    I admit, this is really my first excursion into gui programming under X11.

    Any clues?

    thx INF,
    H.

    Ken Lee wrote:
    > "Hans Horn" wrote in news:qbbcd.31378$QJ3.30308
    > @newssvr21.news.prodigy.com:
    >> what is the "right" order to link in X11 libs?
    >>
    >> I'm using
    >> -lXt -lXm -lXext -lX11 -lIM -lSM -lICE -lXi -li18n

    >
    > Xm before Xt. My web site has a copy of the Motif FAQ.
    >
    > Ken Lee




  4. Re: what is the "right" link order ?

    "Hans Horn" wrote in
    news:MAkcd.31585$QJ3.24417@newssvr21.news.prodigy. com:
    > In the initialization section of the gui I'm using the essential bits
    > from the example and am getting the BadMatch error above (on a TrueColor
    > display), or no error (on a 256 color display).


    Sounds like a bug in your code. My web site has a tutorial on debugging X
    protocol errors like BadMatch.

    Ken Lee, http://www.rahul.net/kenton/

  5. Re: what is the "right" link order ?

    On Sun, 17 Oct 2004 03:30:49 +0000, Ken Lee wrote:

    > "Hans Horn" wrote in
    > news:MAkcd.31585$QJ3.24417@newssvr21.news.prodigy. com:
    >> In the initialization section of the gui I'm using the essential bits
    >> from the example and am getting the BadMatch error above (on a TrueColor
    >> display), or no error (on a 256 color display).

    >
    > Sounds like a bug in your code. My web site has a tutorial on debugging X
    > protocol errors like BadMatch.
    >
    > Ken Lee, http://www.rahul.net/kenton/


    Maybe...maybe not.

    I cut and pasted the 2-1 example right out of the Motif Programming Manual
    (vol 6A) and then compiled it with -lXt -lXm and had almost the same exact
    problem. Using OpenMotif on a Gentoo Linux system. Had I not read the
    parent post, I would have never suspected I had the link order wrong.

    So maybe there needs to be a little addendum somewhere in the docs for new
    Motif hackers stating the proper link order. Or even just making people
    aware that there is a proper link order. (Alot of Linux programmers are
    used to typing "gtk-config --libs --cflags")
    Or maybe someone should write a "motif-config" script.

    Just a little nitpick.

    Freejack


  6. Re: what is the "right" link order ?

    Freejack wrote in
    newsan.2005.01.08.05.38.50.845246@nowhere.net:
    > So maybe there needs to be a little addendum somewhere in the docs for
    > new Motif hackers stating the proper link order.


    My web site has a copy of the Motif FAQ, which answers questions like this.

    Ken Lee, http://www.rahul.net/kenton/

  7. Re: what is the "right" link order ?

    Freejack wrote:
    > Or maybe someone should write a "motif-config" script.
    >
    > Just a little nitpick.
    >
    > Freejack


    I've just added one to LessTif.

    Danny
    --
    Danny Backx - danny.backx-at-scarlet.be

+ Reply to Thread