| View previous topic :: View next topic |
| Author |
Message |
maxx
Joined: 26 Jul 2007 Posts: 7
|
Posted: Sat Jul 28, 2007 2:12 am Post subject: psppower.h |
|
|
I've included the psppower.h in the code but when I compile it says:
| Code: | main.o: In function `make_top()':
main.cpp:(.text+0x8): undefined reference to `scePowerIsBatteryCharging'
main.cpp:(.text+0x40): undefined reference to `scePowerGetBatteryLifePercent'
main.cpp:(.text+0x50): undefined reference to `blife'
main.cpp:(.text+0x5c): undefined reference to `blife'
main.o: In function `main':
main.cpp:(.text+0x108): undefined reference to `scePowerIsBatteryCharging'
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1 |
My code:
| Code: | int make_top(void)
{
int extern blife;
if (scePowerIsBatteryCharging())
{
printf("GFXChanger 0.1 by MaX911 battery: charging \n");
printf("-------------------------------------------------------------------");
return 0;
}
blife = scePowerGetBatteryLifePercent();
printf("GFXChanger 0.1 by MaX911 battery: %s \n", blife);
printf("-------------------------------------------------------------------");
return 0;
}
int main()
{
pspDebugScreenInit();
SetupCallbacks();
SceCtrlData pad;
make_top();
if (scePowerIsLowBattery)
{
printf("\n\n\n\n\n\n\n Battery Power is low, please plug in charger to continue.");
while (1)
{
if (scePowerIsBatteryCharging())
{
break;
}
}
pspDebugScreenClear();
make_top();
printf("\n\n\n\n\n\n\n Charger detected, press [X] to continue.");
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS)
{
pspDebugScreenClear();
make_top();
}
}
sceKernelSleepThread();
return 0;
}
|
|
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
|
| Back to top |
|
 |
maxx
Joined: 26 Jul 2007 Posts: 7
|
Posted: Sat Jul 28, 2007 9:07 am Post subject: |
|
|
How?
EDIT: Done, now it says:
| Code: | main.o: In function `make_top()':
main.cpp:(.text+0x50): undefined reference to `blife'
main.cpp:(.text+0x5c): undefined reference to `blife' |
|
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Sat Jul 28, 2007 9:59 am Post subject: |
|
|
So, where is blife defined?
I expect you just want
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
maxx
Joined: 26 Jul 2007 Posts: 7
|
Posted: Sat Jul 28, 2007 10:08 am Post subject: |
|
|
| Thanks. |
|
| Back to top |
|
 |
|