| View previous topic :: View next topic |
| Author |
Message |
Nekid
Joined: 09 Jul 2005 Posts: 2
|
Posted: Sat Jul 09, 2005 5:56 pm Post subject: Undeclared Error |
|
|
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?t=2374&highlight=cygwin+guide&sid=ea485cc7816403c33d7fe480c8432b8f
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 |
|
| Back to top |
|
 |
auto_exec
Joined: 10 Jul 2005 Posts: 3
|
Posted: Sun Jul 10, 2005 8:28 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
auto_exec
Joined: 10 Jul 2005 Posts: 3
|
Posted: Sun Jul 10, 2005 12:43 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Nekid
Joined: 09 Jul 2005 Posts: 2
|
Posted: Sun Jul 10, 2005 5:06 pm Post subject: |
|
|
| got it to work! thank you!!!! |
|
| Back to top |
|
 |
opzero
Joined: 12 Jul 2005 Posts: 5
|
Posted: Tue Jul 12, 2005 2:56 pm Post subject: |
|
|
:( 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...
Did I do something wrong somewhere else? |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 12, 2005 3:02 pm Post subject: |
|
|
| Install automake and autoconf. |
|
| Back to top |
|
 |
opzero
Joined: 12 Jul 2005 Posts: 5
|
Posted: Tue Jul 12, 2005 4:18 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
71M
Joined: 21 Jun 2005 Posts: 122 Location: London
|
Posted: Tue Jul 12, 2005 5:56 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Energy
Joined: 26 Mar 2005 Posts: 133 Location: uk/beds/flitwick
|
Posted: Tue Jul 12, 2005 10:52 pm Post subject: |
|
|
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... |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed Jul 13, 2005 12:18 am Post subject: |
|
|
Make the configure script executable:
| Code: | | chmod a+x ./configure |
Strange that it isn't already, though.
The 'underquoted definition' errors can generally be ignored safely. |
|
| Back to top |
|
 |
auto_exec
Joined: 10 Jul 2005 Posts: 3
|
Posted: Wed Jul 13, 2005 1:40 am Post subject: |
|
|
| 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). |
|
| Back to top |
|
 |
opzero
Joined: 12 Jul 2005 Posts: 5
|
Posted: Wed Jul 13, 2005 5:19 am Post subject: |
|
|
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.
 |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Wed Jul 13, 2005 5:47 am Post subject: |
|
|
| Update your toolchain. |
|
| Back to top |
|
 |
opzero
Joined: 12 Jul 2005 Posts: 5
|
Posted: Wed Jul 13, 2005 6:12 am Post subject: |
|
|
| mrbrown wrote: | | Update your toolchain. |
Is there a command to do that? Or am I just reinstalling it? |
|
| Back to top |
|
 |
laichung
Joined: 06 May 2005 Posts: 123
|
Posted: Wed Jul 13, 2005 3:20 pm Post subject: |
|
|
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. |
|
|
| Back to top |
|
 |
laichung
Joined: 06 May 2005 Posts: 123
|
Posted: Wed Jul 13, 2005 4:04 pm Post subject: |
|
|
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.objsw.com/CrossGCC/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. |
|
|
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Wed Jul 13, 2005 4:26 pm Post subject: |
|
|
Based on the information you've posted, it's clear that you are using an outdated toolchain.
Update it. |
|
| Back to top |
|
 |
opzero
Joined: 12 Jul 2005 Posts: 5
|
Posted: Wed Jul 13, 2005 4:56 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|