Undeclared Error

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

Moderators: cheriff, TyRaNiD

Post Reply
Nekid
Posts: 2
Joined: Sat Jul 09, 2005 5:35 pm

Undeclared Error

Post by Nekid »

When I try to compile /samples/controller/basic/main.c This is the o/p I get...

$ make

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -02 -G0 -Wall -c -o main.o main.c
main.c: In function 'main':
main.c:69: error: 'SceCtrlData' undeclared (first use in this function)
main.c:69: error: (Each undeclared identifier is reported only once
main.c:69: error: for each fucntion it appeas in.)
main.c:69: error: parse error before 'pad'
main.c:75: error: 'PSP_CTRL_MODE_ANALOG' undeclared (first use in this funciton)

main.c:80: error: 'pad' undeclared (first use in this function)
main.c:86: error: 'PSP_CTRL_SQUARE' undeclared (first use in this function)
...
...
...
same err as line 86 for all the other first time uses of the corresponding PSP_CTRL_FUNC
...
...
...
make: *** [main.o] Error 1



I have followed this guide: http://forums.ps2dev.org/viewtopic.php? ... 80c8432b8f

I skipped number 7 as I did not bother with doxygen-doc...

I was successful to make the sdktest..no errors and got a working eboot.

Any information you have for me to solving this problem would be much appreciated...

Thanks in advance
auto_exec
Posts: 3
Joined: Sun Jul 10, 2005 8:25 am

Post by auto_exec »

Hmm.. I got exact same error using the Msys setup... I think it might be related to this line in the Makefile:

LIBS = -lpspsircs

I checked my psp/sdk/lib and don't see pspsircs.a in there. Haven't been able to find the lib anywhere just yet, either. Let me know if you find a solution.
auto_exec
Posts: 3
Joined: Sun Jul 10, 2005 8:25 am

Post by auto_exec »

ah. the answer was to do the following:


svn co svn://svn.pspdev.org/psp/trunk/pspsdk

then in pspsdk dir,

./bootstrap
./configure
make
make install

updated the pspctrl header file.
Nekid
Posts: 2
Joined: Sat Jul 09, 2005 5:35 pm

Post by Nekid »

got it to work! thank you!!!!
opzero
Posts: 5
Joined: Tue Jul 12, 2005 12:02 pm

Post by opzero »

:( Having a problem with this...

I ran the first line, it worked. I switched to the pspsdk directory, and when I tried to ./bootstrap, it gave me a bunch of errors...

Image

Did I do something wrong somewhere else?
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Install automake and autoconf.
opzero
Posts: 5
Joined: Tue Jul 12, 2005 12:02 pm

Post by opzero »

ooPo wrote:Install automake and autoconf.
Thanks, bootstrap worked, but now I'm getting a permission denied on the configure :(

EDIT: I never really looked at the bootstrap, but when I do it I get a bunch of "underquoted definition" errors...this isn't supposed to happen is it?
71M
Posts: 122
Joined: Tue Jun 21, 2005 5:28 am
Location: London

Post by 71M »

I'm getting exactly the same error, even after installing the latest AutoMake and AutoConf.
Has anyone else using Cygwin gotten this stage of the SDK to work?

Thanks,
71M
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

last night I did a full SVN update.

And I did everything listed there. However my cygwin has got everything. Every possible option was selected. So you maybe missing parts that is required to run. Maybe update your installation?

Though to be honest I didn't try to complie anything particuarly afterwards...
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Make the configure script executable:

Code: Select all

chmod a+x ./configure
Strange that it isn't already, though.

The 'underquoted definition' errors can generally be ignored safely.
auto_exec
Posts: 3
Joined: Sun Jul 10, 2005 8:25 am

Post by auto_exec »

I've also found that when i had problems (after having added packages to cygwin), I removed cygwin and reinstalled with all required packages selected from the start, and that seemed to have fixed it. If you don't get anywhere, then I'd recommend that (reinstall, select DEV package, make sure you have all necessary packages gcc, wget, svn, autoconf, automake, etc).
opzero
Posts: 5
Joined: Tue Jul 12, 2005 12:02 pm

Post by opzero »

Thanks guys, everything so far has worked. Now, another problem *sigh*

I've got the source for an app, and I'm trying to recompile it. I don't believe the makefile is the problem, as other people have used it succesfully.

Image
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Update your toolchain.
opzero
Posts: 5
Joined: Tue Jul 12, 2005 12:02 pm

Post by opzero »

mrbrown wrote:Update your toolchain.
Is there a command to do that? Or am I just reinstalling it?
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Post by laichung »

I use the latest toolchain but I still have the problem like upstair. It that because I using c++ do programming and use psp_g++ for compiling program?

mrbrown wrote:Update your toolchain.
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Post by laichung »

I solve the problem by declare some useless varible to prevent undefined reference. And I found a page about cross gcc which talk about this problem , but I dont know what they say. May be this can help someone.

from http://www.vmlinux.org/crash/mirror/www ... FAQ-5.html

5.4 Where are open, read, write, close, etc. ?

The following is a typical situation people run into when linking their application.


--------------------------------------------------------------------------------

/usr/local/m68k-coff/lib/libc.a(sbrkr.o): In function `_sbrk_r':
sbrkr.c:60: undefined reference to `sbrk'
/usr/local/m68k-coff/lib/libc.a(makebuf.o): In function `__smakebuf':
makebuf.c:93: undefined reference to `isatty'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_open_r':
filer.c:63: undefined reference to `open'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_close_r':
filer.c:100: undefined reference to `close'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_lseek_r':
filer.c:142: undefined reference to `lseek'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_read_r':
filer.c:184: undefined reference to `read'
/usr/local/m68k-coff/lib/libc.a(filer.o): In function `_write_r':
filer.c:226: undefined reference to `write'
/usr/local/m68k-coff/lib/libc.a(fstatr.o): In function `_fstat_r':
fstatr.c:61: undefined reference to `fstat'


--------------------------------------------------------------------------------

Depending upon the target, system calls are not built into newlib's libc.a. They are too dependent upon the particular target board in use. Libgloss (which comes with newlib net releases) is intended to be the repository of such routines and may either provide them in another library that you must link against or in an object file. For systems that don't have a need for such routines, just stub them out. e.g.


--------------------------------------------------------------------------------

int open (char *f, int flags, ...) { errno = ENOSYS; return -1; }


--------------------------------------------------------------------------------

etc.

laichung wrote:I use the latest toolchain but I still have the problem like upstair. It that because I using c++ do programming and use psp_g++ for compiling program?

mrbrown wrote:Update your toolchain.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Based on the information you've posted, it's clear that you are using an outdated toolchain.

Update it.
opzero
Posts: 5
Joined: Tue Jul 12, 2005 12:02 pm

Post by opzero »

Wewt, fixed it...thanks all!

I just reinstalled toolchain :) Took a hell of a long time, if there was any easier way to update I'd like to know :P
Post Reply