Re: XForms: displaying results

Martin Doll, Ph. D. (mkhd@into.ch)
Sat, 10 Apr 1999 21:41:33 +0100

# To subscribers of the xforms list from "Martin Doll, Ph. D." <mkhd@into.ch> :

This is a multi-part message in MIME format.
--------------A358E62C7CD63C68094F6F0A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Thank you very much for providing all that detailed information. Yeah,
I'm ashame now, but this is my callback, associated with a button
"comp_mass_button" now:

void get_mass_cmpd(FL_OBJECT *ob, long data) {

if (line_input_1 != NULL) {
strcpy(line_input, line_input_1);
M_compd = process_mass(line_input);
printf("M_compd: %f.\n", M_compd);

readout(fd_martin1->result_compd, "%g", M_compd); /*readout is
in "martin1.h"*/
}

I compile and get:

martin1.c:
martin1_cb.c:
cfe: Error: martin1_cb.c, line 32: 'fd_martin1' undefined; reoccurrences
will not be reported.
readout(fd_martin1->result_compd, "%g", M_compd);
--------^
martin1_main.c:
mproc.c:

My files here in this case are called martin1_something; so I assume
fd_martin1 is the right thing?!

In martin1.h there is:

typedef struct {
void *vdata;
char *cdata;
long ldata;
FL_OBJECT *comp_mass_button;
.....more.......
} martin1;

Sorry, but I don't know anyone exept this list to ask (once it's done
it'll be cute).

Best,
Martin
--------------A358E62C7CD63C68094F6F0A
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="74747874";
name="touch"
Content-Transfer-Encoding: 7bit
Content-Description: Unknown Document
Content-Disposition: inline;
filename="touch"

this is my callback, associated with a button "comp_mass_button":

/* callbacks and freeobj handles for form martin1 */
void get_mass_cmpd(FL_OBJECT *ob, long data)
{

if (line_input_1 != NULL) {
strcpy(line_input, line_input_1);
M_compd = process_mass(line_input);
printf("M_compd: %f.\n", M_compd);

readout(fd_martin1->result_compd, "%g", M_compd);
}

I compile and get:

Cindy 32% generate
martin1.c:
martin1_cb.c:
cfe: Error: martin1_cb.c, line 32: 'fd_martin1' undefined; reoccurrences will not be reported.
readout(fd_martin1->result_compd, "%g", M_compd);
--------^
martin1_main.c:
mproc.c:

When I ad on top of the martin1_cb.c file (my stuff here's called martin1)

FD_martin1 *fd_martin1;

I get:

Cindy 36% generate
martin1.c:
martin1_cb.c:
martin1_main.c:
mproc.c:
ld: WARNING 15: multiply defined:(readout) in martin1.o and martin1_cb.o (2nd definition ignored).
ld: WARNING 15: multiply defined:(readout) in martin1.o and martin1_main.o (2nd definition ignored).

If I put "extern FD_martin1 *fd_martin;" there I get:

Cindy 38% generate
martin1.c:
martin1_cb.c:
martin1_main.c:
mproc.c:
ld: WARNING 15: multiply defined:(readout) in martin1.o and martin1_cb.o (2nd definition ignored).
ld: WARNING 15: multiply defined:(readout) in martin1.o and martin1_main.o (2nd definition ignored).
ld: ERROR 33: Unresolved data symbol "fd_martin1" -- 1st referenced by martin1_cb.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld: INFO 152: Output file removed because of error.

If I also include "martin1_main.c" I get:

ld: WARNING 15: multiply defined:(readout) in martin1.o and martin1_cb.o (2nd definition ignored).
ld: WARNING 15: multiply defined:(readout) in martin1.o and martin1_main.o (2nd definition ignored).
ld: WARNING 15: multiply defined:(main) in martin1_cb.o and martin1_main.o (2nd definition ignored).
ld: ERROR 33: Unresolved data symbol "fd_martin1" -- 1st referenced by martin1_cb.o.
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld: INFO 152: Output file removed because of error.

--------------A358E62C7CD63C68094F6F0A--

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/