Error on Zorba's Adhoc example

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jo3_sum
Posts: 17
Joined: Wed Jan 30, 2008 5:38 am
Contact:

Error on Zorba's Adhoc example

Post by jo3_sum »

I edited all the errors I originally got, but I can't slove this one. According to the psp docs this, should work, but my compiler says otherwise. Maybe my lib for this function is out of date; however, I updated my sdk using the 4.01 m33-2 sdk update.


1>ZBadhoc.cpp (699) : error: invalid conversion from 'void (*)(int, int, unsigned char*, int, char*)' to 'void (*)(int, int, unsigned char*, int, void*)'
1>ZBadhoc.cpp (699) : error: initializing argument 9 of 'int sceNetAdhocMatchingCreate(int, int, int, int, int, int, int, int, void (*)(int, int, unsigned char*, int, void*))'


Code: Select all

1>------ Build started: Project: PSP Adhoc, Configuration: Debug Win32 ------
1>Performing Makefile project actions
1>psp-g++ -I. -I C:/pspdev/psp/sdk/include  -g -G0 -Wall -O3 -D_PSP_FW_VERSION=371 -fno-rtti -fno-exceptions -c -o ZBadhoc.o ZBadhoc.cpp
1>ZBadhoc.cpp: In member function 'void ZBadhoc::createMatching()':
1>ZBadhoc.cpp (699) : error: invalid conversion from 'void (*)(int, int, unsigned char*, int, char*)' to 'void (*)(int, int, unsigned char*, int, void*)'
1>ZBadhoc.cpp (699) : error:   initializing argument 9 of 'int sceNetAdhocMatchingCreate(int, int, int, int, int, int, int, int, void (*)(int, int, unsigned char*, int, void*))'
1>make: *** [ZBadhoc.o] Error 1
1>Build log was saved at "file://c:\Users\Joe\Desktop\misc\PSP Adhoc\PSP Adhoc\Debug\BuildLog.htm"
1>PSP Adhoc - 2 error(s), 0 warning(s)
jo3_sum
Posts: 17
Joined: Wed Jan 30, 2008 5:38 am
Contact:

Post by jo3_sum »

Luckily, roe-ur-boat on MSN told me what was the problem. All I had to do was to change:

Code: Select all

 
void matchingCB(int unk1, int event, unsigned char *macSource, int size, char *data)
{
...
}
to

Code: Select all

void matchingCB(int unk1, int event, unsigned char *macSource, int size, void *data)
{
...
}
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

Post by pspZorba »

Yep he is right the previous def (with a char *) is an old version which was in line with a previous and old SDK.

The new version with the void* is more precise and in line with last SDK versions .
--pspZorba--
NO to K1.5 !
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

or just use casts AND using the latest SDK and toolchain, you must declare the adhoc events in your program.
Image
Upgrade your PSP
Post Reply