make Error

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

Moderators: cheriff, TyRaNiD

Post Reply
axxel
Posts: 9
Joined: Sun Oct 16, 2005 2:10 pm

make Error

Post by axxel »

Hi,
I have this result:

Code: Select all

[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: Select all

/*
 * 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 &#40;c&#41; 2005 Marcus R. Brown <[email protected]>
 * Copyright &#40;c&#41; 2005 James Forshaw <[email protected]>
 * Copyright &#40;c&#41; 2005 John Kelley <[email protected]>
 * Copyright &#40;c&#41; 2005 Donour Sizemore <[email protected]>
 *
 * $Id&#58; main.c 1095 2005-09-27 21&#58;02&#58;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&#40;"CONTROLTEST", 0, 1, 1&#41;;

/* Define the main thread's attribute value &#40;optional&#41; */
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;

/* Define printf, just to make typing easier */
#define printf	pspDebugScreenPrintf

void dump_threadstatus&#40;void&#41;;

int done = 0;

/* Exit callback */
int exit_callback&#40;int arg1, int arg2, void *common&#41;
&#123;
	done = 1;
	return 0;
&#125;

/* Callback thread */
int CallbackThread&#40;SceSize args, void *argp&#41;
&#123;
	int cbid;

	cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
	sceKernelRegisterExitCallback&#40;cbid&#41;;
	sceKernelSleepThreadCB&#40;&#41;;

	return 0;
&#125;

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks&#40;void&#41;
&#123;
	int thid = 0;

	thid = sceKernelCreateThread&#40;"update_thread", CallbackThread,
				     0x11, 0xFA0, 0, 0&#41;;
	if&#40;thid >= 0&#41;
	&#123;
		sceKernelStartThread&#40;thid, 0, 0&#41;;
	&#125;

	return thid;
&#125;

int main&#40;void&#41;
&#123;
	SceCtrlData pad;

	pspDebugScreenInit&#40;&#41;;
	SetupCallbacks&#40;&#41;;

	sceCtrlSetSamplingCycle&#40;0&#41;;
	sceCtrlSetSamplingMode&#40;PSP_CTRL_MODE_ANALOG&#41;;

	while&#40;!done&#41;&#123;
		pspDebugScreenSetXY&#40;0, 2&#41;;

    		sceCtrlReadBufferPositive&#40;&pad, 1&#41;; 

		printf&#40;"Analog X = %d ", pad.Lx&#41;;
		printf&#40;"Analog Y = %d \n", pad.Ly&#41;;

		if &#40;pad.Buttons != 0&#41;&#123;
			if &#40;pad.Buttons & PSP_CTRL_SQUARE&#41;&#123;
				printf&#40;"Square pressed \n"&#41;;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_TRIANGLE&#41;&#123;
				printf&#40;"Triangle pressed \n"&#41;;
			&#125; 
			if &#40;pad.Buttons & PSP_CTRL_CIRCLE&#41;&#123;
				printf&#40;"Cicle pressed \n"&#41;;
			&#125; 
			if &#40;pad.Buttons & PSP_CTRL_CROSS&#41;&#123;
				printf&#40;"Cross pressed \n"&#41;;
			&#125; 

			if &#40;pad.Buttons & PSP_CTRL_UP&#41;&#123;
				printf&#40;"Up pressed \n"&#41;;
			&#125; 
			if &#40;pad.Buttons & PSP_CTRL_DOWN&#41;&#123;
				printf&#40;"Down pressed \n"&#41;;
			&#125; 
			if &#40;pad.Buttons & PSP_CTRL_LEFT&#41;&#123;
				printf&#40;"Left pressed \n"&#41;;
			&#125; 
			if &#40;pad.Buttons & PSP_CTRL_RIGHT&#41;&#123;
				printf&#40;"Right pressed \n"&#41;;
			&#125;      

			if &#40;pad.Buttons & PSP_CTRL_START&#41;&#123;
				printf&#40;"Start pressed \n"&#41;;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_SELECT&#41;&#123;
				printf&#40;"Select pressed \n"&#41;;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41;&#123;
				printf&#40;"L-trigger pressed \n"&#41;;
			&#125;
			if &#40;pad.Buttons & PSP_CTRL_RTRIGGER&#41;&#123;
				printf&#40;"R-trigger pressed \n"&#41;;
			&#125;      
		&#125;
	&#125;

	sceKernelExitGame&#40;&#41;;
	return 0;
&#125;
Anyone understand why?

ThX much -- I'm under FC4
-----------------------------------------------------------------
Don't Think about what the Code do, be the Code...
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

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?
fluxscan
Posts: 1
Joined: Thu Oct 20, 2005 12:35 am

Compile guide...

Post by fluxscan »

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)
Post Reply