[comp.windows.open-look] compile/link problem - summary LONG

steve@cad0.arch.unsw.oz.au (Stephen Peter) (03/02/91)

Two  people have asked for a summary of the responses I received relating
to my link problem.  Therefore, included below are the reponses.

__________________________________________________________________________
My original message:

> G'Day all,
> 
> Silly beginners question here.  I am trying to compile a simple
> "hello world" program (to run under openwindows).  The program 
> seems to compile OK, but gives a (link?) error.
> 
> my command is:
> 
> cc -I/usr/openwin/include -L/usr/openwin/lib -lxview -lolgx -lxvps xhello.c
> 
> I then get the following error message:
> 
> ld: Undefined symbol 
>    __XtInherit 
>    _XtRealizeWidget 
>    _XtMainLoop 
>    _staticTextWidgetClass 
>    _XtCreateManagedWidget 
>    _OlInitialize 
> 
> I conclude from this that the linker didnt find the openwindows libraries.
> 
> Any help and/or suggestions welcome.
> 
__________________________________________________________________________

Problem is that you're writing code to work with the OLIT toolkit but
linking with the XView libraries.  The undefined symbols are all OLIT
or X Intrinsic functions.

Hank Shiffman                                     (415) 336-4658
Marketing Technical Specialist
Sun Microsystems, Inc.                      shiffman@Eng.Sun.COM
__________________________________________________________________________

From: Syst{ Kari <ks@tut.fi>

At least you are missing -lX !

The names of the undefined symbols suggest that you have used Xt toolkit
instead of xview. (Is it OLIT ?)
If so, you should use command:

cc -I$OPENWINHOME/include xhello.c -L$OPENWINHOME/lib -lXol -lolgx -lXt -lX
__________________________________________________________________________

From: fhage@virga.rap.ucar.EDU (Frank Hage)

My makefiles use: -lxview -lolgx -lX -lm
for the linker arguments.

-Frank.
__________________________________________________________________________

If you're writing an OpenWindows program, you should be using XView
commands.  I'm not too sure myself about interfacing the two as I've
not done that myself, but I guess you need to add
 
 -I/usr/include/X11 -lX

which should help the linker find the include files and link with the
X libraries.  If -lX doesn't work, I wonder if -lXt might?

Sorry if I couldn't be much help.

-Himanshu Gohel, gohel@screamer.csee.usf.edu
 Univ of South Florida, Tampa, FL 33620 USA
__________________________________________________________________________

you might get swamped anyway, just my 10 cents.
try:

   cc -I/usr/openwin/include -L/usr/openwin/lib xhello.c -lxview -lolgx -lxvps 
                                                ^^^^^^^^

There has to be some unresolved functions before anything is taken
from the libraries. At least that what I thought when I had a similar
problem. 

Max Ott                      e-mai   ott@hatori.t.u-tokyo.ac.jp
__________________________________________________________________________
end.


--
 _--_|\
/      \    Stephen Peter                         steve@cad0.arch.unsw.oz.au
\_.--._/<-------------------------------------------------------------------
      v     School of Architecture, University of New South Wales, Australia