Re: [NEWBIE][LONG]defined reference

From: Thomas Arp (t_arp@stofanet.dk)
Date: 01/19/03


From: "Bill Pascoe" <wspascoe@BELLSOUTH.NET>
> >db.o: In function `save_char_file_u':
> >/util/circle30bpl21/src/db.c:3036: undefined reference to `find_name'
> --snip---
> it doesnt recognize the phrase find_name
> ---snip---
> >int find_name(char *name);
>
> >void save_char_file_u(struct char_file_u st)
> >{
> >int player_i;
> >
> >if((player_i=find_name(st.name)) >=0 )
>  > {
>   >fseek(player_fl, player_i * sizeof(struct char_file_u), SEEK_SET);
>   >fwrite(&st, sizeof(struct char_file_u), 1, player_fl);
>   >}
> >}
> ---snip----
> try changing it to this:
>
> void save_char_file_u(struct char_file_u st)
> {
> int player_i;
> int find_name(char *name);
>
> if((player_i=find_name(st.name)) >=0 )
>  {
> fseek(player_fl, player_i * sizeof(struct char_file_u), SEEK_SET);
> fwrite(&st, sizeof(struct char_file_u), 1, player_fl);
>   }
> }

I'm not sure this will help. After all, in the original version, find_name
was prototyped as well. The error is a linker error, stating that the
_prototyped_ function could not be found in any of the other files.
However, I seem to recall some issues around bpl21 with regards to
the functions

long get_ptable_by_name(char *name);
and
int find_name(char *name);

which incidentally does the same thing. One of them was removed/renamed
throughout the source, AFAIR.

My suggestion:

grep find_name *.[ch]
grep get_ptable_by_name *.[ch]

Make sure to include the file which defines find_name in the make, or if
none exist, rename the function call to get_ptable_by_name instead.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT