 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
axxel
Joined: 16 Oct 2005 Posts: 9
|
Posted: Mon Oct 17, 2005 10:11 am Post subject: make Error |
|
|
Hi,
I have this result:
| Code: |
[root@localhost basic]# make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o main.c
main.c:45: erreur: syntax error before ‘args’
main.c: In function ‘main’:
main.c:73: erreur: ‘SceCtrlData’ undeclared (first use in this function)
main.c:73: erreur: (Chaque identificateur non déclaré est rapporté une seule fois
main.c:73: erreur: pour chaque fonction dans laquelle il apparaît.)
main.c:73: erreur: syntax error before ‘pad’
main.c:79: erreur: ‘PSP_CTRL_MODE_ANALOG’ undeclared (first use in this function)
main.c:84: erreur: ‘pad’ undeclared (first use in this function)
main.c:90: erreur: ‘PSP_CTRL_SQUARE’ undeclared (first use in this function)
main.c:93: erreur: ‘PSP_CTRL_TRIANGLE’ undeclared (first use in this function)
main.c:96: erreur: ‘PSP_CTRL_CIRCLE’ undeclared (first use in this function)
main.c:99: erreur: ‘PSP_CTRL_CROSS’ undeclared (first use in this function)
main.c:103: erreur: ‘PSP_CTRL_UP’ undeclared (first use in this function)
main.c:106: erreur: ‘PSP_CTRL_DOWN’ undeclared (first use in this function)
main.c:109: erreur: ‘PSP_CTRL_LEFT’ undeclared (first use in this function)
main.c:112: erreur: ‘PSP_CTRL_RIGHT’ undeclared (first use in this function)
main.c:116: erreur: ‘PSP_CTRL_START’ undeclared (first use in this function)
main.c:119: erreur: ‘PSP_CTRL_SELECT’ undeclared (first use in this function)
main.c:122: erreur: ‘PSP_CTRL_LTRIGGER’ undeclared (first use in this function)
main.c:125: erreur: ‘PSP_CTRL_RTRIGGER’ undeclared (first use in this function)
make: *** [main.o] Erreur 1
|
when I execute 'make' on this following sample code:
| Code: |
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* main.c - Basic Input demo -- reads from control pad and indicates button
* presses.
*
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
* Copyright (c) 2005 Donour Sizemore <donour@uchicago.edu>
*
* $Id: main.c 1095 2005-09-27 21:02:16Z jim $
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <string.h>
/* Define the module info section */
PSP_MODULE_INFO("CONTROLTEST", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
/* Define printf, just to make typing easier */
#define printf pspDebugScreenPrintf
void dump_threadstatus(void);
int done = 0;
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
done = 1;
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread,
0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main(void)
{
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
while(!done){
pspDebugScreenSetXY(0, 2);
sceCtrlReadBufferPositive(&pad, 1);
printf("Analog X = %d ", pad.Lx);
printf("Analog Y = %d \n", pad.Ly);
if (pad.Buttons != 0){
if (pad.Buttons & PSP_CTRL_SQUARE){
printf("Square pressed \n");
}
if (pad.Buttons & PSP_CTRL_TRIANGLE){
printf("Triangle pressed \n");
}
if (pad.Buttons & PSP_CTRL_CIRCLE){
printf("Cicle pressed \n");
}
if (pad.Buttons & PSP_CTRL_CROSS){
printf("Cross pressed \n");
}
if (pad.Buttons & PSP_CTRL_UP){
printf("Up pressed \n");
}
if (pad.Buttons & PSP_CTRL_DOWN){
printf("Down pressed \n");
}
if (pad.Buttons & PSP_CTRL_LEFT){
printf("Left pressed \n");
}
if (pad.Buttons & PSP_CTRL_RIGHT){
printf("Right pressed \n");
}
if (pad.Buttons & PSP_CTRL_START){
printf("Start pressed \n");
}
if (pad.Buttons & PSP_CTRL_SELECT){
printf("Select pressed \n");
}
if (pad.Buttons & PSP_CTRL_LTRIGGER){
printf("L-trigger pressed \n");
}
if (pad.Buttons & PSP_CTRL_RTRIGGER){
printf("R-trigger pressed \n");
}
}
}
sceKernelExitGame();
return 0;
}
|
Anyone understand why?
ThX much -- I'm under FC4 _________________ -----------------------------------------------------------------
Don't Think about what the Code do, be the Code... |
|
| Back to top |
|
 |
seventoes
Joined: 02 Oct 2005 Posts: 79
|
Posted: Mon Oct 31, 2005 6:01 am Post subject: |
|
|
FC4 is fedora core right? I dont use linux so idk if this is right, but i think you are typing "# make" all you need to type is "make"
thats probably not your problem...
What is in your makefile? |
|
| Back to top |
|
 |
fluxscan
Joined: 20 Oct 2005 Posts: 1
|
Posted: Thu Nov 10, 2005 2:18 am Post subject: Compile guide... |
|
|
Hi, I successed to compile it..
First, SceCtrlData --> ctrl_data_t pad chage!
Because Buttons member in pspctrl.h is included by ctrl_data_t structure.
So, Buttons is incorrect .. buttons is ..
PSP_CTRL_MODE_ANALOG is not identified..
You must define it's value...
Example, #define PSP_CTRL_MODE_ANALOG 0
You Must replace PSP_CTRL_XXX to CTRL_XXX ...
This is defined by pspctrl.h
AnyWay, If you execute this way, You can success to compile it ...
Good Bye... _________________ PSP : PSP 1005K
UMD : FIFA, Ridge Racer
DEV. MACHINE : Intel Pentium SmithField 820 (2.8Ghz, Dual Core) /1GB RAM(SAMSUNG 533Mhz ,PC4200, SDRAM) /WD 200GB STAT HDD / ATI Radeon X600 (128MB) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|