Linker problem

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
AmeNeko
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 32
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Jan 08, 2004 4:48 pm
Has thanked: 0
Been thanked: 0
Contact:

Linker problem

Post by AmeNeko »

I'm having a problem when my program is linking. It all compiles fine, just doesn't link. The error I'm getting is like this...

Code: Select all

main.cc: In function `int main(int, char**)':

main.cc:95: no matching function for call to `CSprite::spriteLoadTex(GLuint*, const char[14])'

tile_accelerator.h:58: candidates are: int CSprite::spriteLoadTex(long unsigned int, const char*)
the code definition reads as...

Code: Select all

int spriteLoadTex(GLuint tex, const char *fn);
and the call reads like this...

Code: Select all

spriteTest.spriteLoadTex(&texFrameIndex, "/rd/crate.pcx");
Now what really confuses me is that if I switch it to

Code: Select all

(const char *fn, GLuint tex)
it works just fine. I'm using Cygwin with kos 1.1.9, binutils 2.11.2, newlib 1.9.0 and gcc 3.0.3.
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Post by nymus »

you are passing &tex... so the function definition should be GLuint* and not GLuint. (pointer vs int)
behold the mind
inspired by Dreamcast
Strapping Scherzo
DC Developer
DC Developer
Posts: 2285
Joined: Fri Feb 21, 2003 7:37 am
Location: Chicago, IL
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Strapping Scherzo »

You're passing a pointer to a GLuint when you call it, but the function definition doesn't take a pointer, just a GLuint. I don't know if you intend on changing the value of the GLuint passed into the function. If you aren't, don't bother passing a pointer to it. Basically, the types don't match for the first parameter.
Image
AmeNeko
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 32
Joined: Thu Jan 08, 2004 4:48 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by AmeNeko »

Yeah, I got it as soon as you posted :-D Thanks tho.... was gonna ask another question, but it was a stupid fix.
Post Reply