xforms-development
[Top][All Lists]
Advanced

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

Re: [XForms] gcc not found forms.h definitions


From: Jens Thoms Toerring
Subject: Re: [XForms] gcc not found forms.h definitions
Date: Fri, 23 Sep 2011 02:28:18 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Sergey,

On Thu, Sep 22, 2011 at 02:52:56PM -0700, Sergey Klimkin wrote:
> I have installed the program fdesign-xForms on the computer.
> Has written a test program.
> At compilation 2 objective files are created.
> After that the compiler gcc informs that cannot collect objects in an
> executed file. The compiler does not find definitions of functions which are
> in a file forms.h

What you show later aren't error messages from the compiler but
from the linker - the compiler seems to have found your program
to be quite ok.

> Files forms.h and flimage.h also are there where they were established by
> the installation program - /usr/local/include/.

Yes, if they hadn't been found there would have been lots of error
messages from the compiler.

> Makefile
> CC = gcc -Wall
> OUTPUT = survey
> $(OUTPUT): survey_main.o survey.o
>     $(CC): survey_main.o -o $(OUTPUT) 
> survey_main.o: survey_main.c survey.h
>     $(CC) -c survey_main.c -o survey_main.o
> survey.o: survey.c survey.h
>     $(CC) -c survey.c -o survey.o
> clean:
>     -rm *.o *~ -f
> 
> Here is how the terminal window looks.
> 
> address@hidden:~$ cd /home/sklimkin/projects/fdesign/surveyfd
> address@hidden:~/projects/fdesign/surveyfd$ make
> gcc -Wall: survey_main.o -o survey 
> survey_main.o: In function `main':
> survey_main.c:(.text+0x2f): undefined reference to `fl_initialize'
> survey_main.c:(.text+0x34): undefined reference to `create_form_SURVEYING'
> survey_main.c:(.text+0x5e): undefined reference to `fl_show_form'
> survey_main.c:(.text+0x63): undefined reference to `fl_do_forms'
> survey_main.c:(.text+0x71): undefined reference to `fl_form_is_visible'
> survey_main.c:(.text+0x83): undefined reference to `fl_hide_form'
> survey_main.c:(.text+0x89): undefined reference to `fl_free'
> survey_main.c:(.text+0x97): undefined reference to `fl_finish'
> collect2: ld returned 1 exit status
> make: *** [survey] Error 1

All of these are linker, not compiler, errors.

> What it is necessary to correct, that the program was compiled to an
> executed file?

As far as I can see all that's missing is that you're not linking
against the XForms library, thus the linker errors about missing
references (which all are functions in the XForms library). From
the information you have posted I would guess that changing just
one line in the Makefile

> $(OUTPUT): survey_main.o survey.o
>     $(CC): survey_main.o -o $(OUTPUT) 

to

$(OUTPUT): survey_main.o survey.o
    $(CC): survey_main.o -o $(OUTPUT) -lforms

(note the additional '-lforms' in the second line) is all that's
needed. The '-lforms' bit tells the linker that it should have a
look into the XForms library (libforms.so) for the still undefined
references.
                           Best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de



reply via email to

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