Syntax errors from GNU program source code.

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

Moderators: cheriff, TyRaNiD

Post Reply
nousplacidus
Posts: 6
Joined: Wed Sep 28, 2005 7:44 am

Syntax errors from GNU program source code.

Post by nousplacidus »

I am try as best I can to port some software to my psp for a class im taking here at school (nano the text editor). Thanks to you guys here for making it so easy to get started. Heres my problem.

Code: Select all

/usr/include/ncurses.h:553: error: syntax error before '*' token
/usr/include/ncurses.h:639: error: syntax error before 'FILE'
and here is the line a few before and a few after in the corresponding
ncurses.h

Code: Select all

551 extern NCURSES_EXPORT(int) getnstr (char *, int);           /* generated */
    552 extern NCURSES_EXPORT(int) getstr (char *);             /* generated */
    553 extern NCURSES_EXPORT(WINDOW *) getwin (FILE *);            /* implemented */
    554 extern NCURSES_EXPORT(int) halfdelay (int);             /* implemented */
    555 extern NCURSES_EXPORT(bool) has_colors (void);              /* implemented */
and the second error

Code: Select all

 
636 extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int);   /* generated */
    637 extern NCURSES_EXPORT(int) napms (int);                 /* implemented */
    638 extern NCURSES_EXPORT(WINDOW *) newpad (int,int);               /* implemented */
    639 extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *);   /* implemented */
    640 extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int);           /* implemented */


heres my makefile also for you guys.

Code: Select all

TARGET = nano
OBJS = color.o cut.o files.o global.o move.o nano.o rcfile.o search.o utils.o winio.o

INCDIR = intl /usr/local/share /usr/include
CFLAGS = -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS= -lpspgum -lpspgu -lm -lncurses

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Nano

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
I know I probably have bigger problems but I will get to those once I get these syntax errors solved. Is there some preprocessor I need to define or is there something I need to add to the makefile?

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

Post by mrbrown »

You need to stop trying to build with ncurses which hasn't been ported to the PSP.
nousplacidus
Posts: 6
Joined: Wed Sep 28, 2005 7:44 am

Post by nousplacidus »

Well that pretty much sucks, I took the -lncurses flag out, and still no luck, I don't think that answers my question about the syntax error though it might. I just don't see why it wouldn't give me something with regards to an undeclared symbol or something along those lines.

Regards
nousplacidus
Posts: 6
Joined: Wed Sep 28, 2005 7:44 am

Post by nousplacidus »

Ok maybe I should refrase this,

what is causing the syntax error OTHER than ncurses, because that has nothing to do with the compiler seeing that and recognizing it as a syntax error because its doing in the same thing in one of my other attempts on a different program.

thanks
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Maybe you should read a manual. Removing -lncurses just gets rid of the linker trying to access the ncurses library you can't build. Problem is, ncurses won't build on PSP without extra work. You need to do that work.

Jim
nousplacidus
Posts: 6
Joined: Wed Sep 28, 2005 7:44 am

Post by nousplacidus »

got it, ncurses won't compile...

What is the syntax error, I have tried compiling other things that give me the same syntax error and have NOTHING TO DO with ncurses.

thanks....

Code: Select all

/usr/include/openssl/evp.h:277: error: syntax error before '*' token
/usr/include/openssl/evp.h:278: error: syntax error before '*' token
/usr/include/openssl/evp.h:279: error: syntax error before '*' token
/usr/include/openssl/evp.h:280: error: syntax error before '*' token



and heres the corresponding lines from evp.h

Code: Select all

    277     int (*init)(EVP_MD_CTX *ctx);
    278     int (*update)(EVP_MD_CTX *ctx,const void *data,unsigned long count);
    279     int (*final)(EVP_MD_CTX *ctx,unsigned char *md);
    280     int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from);
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

In this case, the compiler reaches those lines and doesn't know the types WINDOW and FILE. For some reason it hasn't seen them yet. Probably because the build isn't configured properly.
Try building something simpler to start with.

Jim
Post Reply