xforms-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XForms] Fwd: Compiling an Xforms program that uses Xlib calls, under


From: Peter Rowat
Subject: [XForms] Fwd: Compiling an Xforms program that uses Xlib calls, under OSX
Date: Wed, 18 Nov 2015 13:03:54 -0800



Solved: both of these terms, in this order, 

  -L/opt/X11/lib   -lX11 

must be present at the end of the gcc command, before or after -lforms.

Thank you both, Jens and Jon, for the help.  What trivia.

Peter 

On Nov 18, 2015, at 11:49 AM, Jens Thoms Toerring <address@hidden> wrote:

Hi Peter,

On Wed, Nov 18, 2015 at 11:37:20AM -0800, Peter Rowat wrote:

gcc -v -Wall -I/usr/local/include -I/opt/X11/include -o XXX XXX.c -L/usr/local/lib  -lforms


Using this command, when XXX.c is an XForms program NOT using any Xlib
calls, compilation is successful, but when XXX.c has Xlib calls such as
XDrawLines, compilation fails. (I changed my #include “forms.h” to
<forms.h>)

Perhaps this is related to the presence of Apple's Xcode app, and I should
try the compilation from inside Xcode.

I have no experience at all With Apple and Xcode, so a lot of
the output is incomprehensible to me:-(

Undefined symbols for architecture x86_64:
 "_XDrawLines", referenced from:
     _draw_triangle in trime-c64e11.o
 "_XFillPolygon", referenced from:
     _draw_triangle in trime-c64e11.o
 "_XSetForeground", referenced from:
     _draw_triangle in trime-c64e11.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [trime] Error 1

No idea if this will help, but have you tried to explicitly
link also against libX11? Under Linux it's enough that libforms
depends on it (since a few years, before you also had to add it),
but perhaps that's different on ypur platform. What happens if you
put a '-lX11' after '-lforms' (or before it or maybe have it before
and after it)?
                            Best regards, Jens
-- 
 \   Jens Thoms Toerring  ________      address@hidden
  \_______________________________      http://toerring.de


reply via email to

[Prev in Thread] Current Thread [Next in Thread]