Mail Archives: djgpp/1997/07/20/07:02:19
Jacob Martin <jake AT gapeach DOT com> wrote in article
<33D10773 DOT 45C94A8D AT gapeach DOT com>...
> how do I do this? I keep getting bad comilation stuff....
>
> I thought I had it right, then I started the whole..."hmmm, add another
> star?hmmm remove a star...hmmm"
>
> and I finally got it to compile( halfway) but it gives me this:
>
> E:\game>gxx test.cc -lj -lm
> e:/djgpp/tmp\ccdaaaaa(.text+0xc0):test.cc: undefined reference to
> `mapmaker(int
> *, int)'
> e:/djgpp/tmp\ccdaaaaa(.text+0x170):test.cc: undefined reference to
> `frenchtile(i
> nt *, buffer_rec *, bufinde *, int)'
>
> Here's the relevant code...
>
> void frenchtile(int *,buffer_rec *bufferptr,bufinde *btp, int);
> void mapmaker (int *,int) ;
[...]
> void frenchtile(int **mmp,buffer_rec *bufferptr,bufinde *btp,int page)
[...]
> void mapmaker (int **mmp, int size) {
The problem is that you're using C++ ;). If you compiled that code as C,
the compiler would shout at you for passing int * to a function that wants
int **. C++ allows multiple definitions for a given function, with
different parameter types, so it compiles and then tries to link to the
mapmaker (int **,int) function, which doesn't exist...
[...]
> Thanks...
>
No problem.
---
Russ
- Raw text -