[Top][All Lists]

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

Re: [XForms] Why does gcc not find the forms library?

From: Jens Thoms Toerring
Subject: Re: [XForms] Why does gcc not find the forms library?
Date: Mon, 12 Oct 2015 22:29:41 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Peter,

On Mon, Oct 12, 2015 at 12:32:35PM -0700, Peter Rowat wrote:
> On OS X, I’ve installed XForms and compiled the demos and they all work. 
> But trying to compile the simplest program directly, e.g.
> gcc -o pshme pshme.c -lforms 

> fails with "ld: library not found for -lforms”

Did you install it (i.e. did you run "make install")? And if you
did, did it get installed in a path the linker checks for per
default? The default for the installation is '/usr/local/lib'.
And even then you may have to make the runtime linker aware of
newly installed libraries.

I have no experience with OS X, but on Linux you need to run
'ldconfig' (as root) before it gets found after installing it
for the very first time. And the runtime linker can be made
to include '/usr/local/lib' into the default search path by
editing /etc/ld.so.conf' or, on newer systems, creating a file
with in 'etc/ld.so.conf.d'. Perhaps it's handled in a similar
way under OS X?
> Same happens if I tell gcc where to look:
> gcc -o pshme pshme.c -L/….../xforms-1.2.4/lib -lforms
> ls lib/*forms*
> lib/forms.c   lib/forms.lo    lib/forms.o     lib/libforms.la lib/xforms.5    
> lib/xforms.man

The finished library is in 'lib/.lib', not in the 'lib'
directory itself. So it should work with

> gcc -o pshme pshme.c -L/….../xforms-1.2.4/lib/.lib -lforms

                         Best regards, Jens
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de

reply via email to

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