forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

can't solve "conflicting types Problem" [SOLVED (s

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
mgschwan



Joined: 17 Apr 2007
Posts: 3

PostPosted: Tue Apr 17, 2007 4:53 am    Post subject: can't solve "conflicting types Problem" [SOLVED (s Reply with quote

Hello

i have been searching around in the forums for quite a while but i can not find a solution to my problem. I even can't find someone who had the exact same problem.

i am running gentoo linux and installed the psp toolchain (by first downloading it, updating it via svn and then compiling and installing it). I also installed the pspsdk (first i tried the binary version and then i checked it out from svn and compiled it)

So far so good

But if i try to compile for example the lines demo in the psp-sdk i get the following error


Code:
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -D_PSP_FW_VERSION=150   -c -o lines.o lines.c
In file included from /usr/local/pspdev/psp/sdk/include/pspuser.h:26,
                 from /usr/local/pspdev/psp/sdk/include/pspkernel.h:18,
                 from lines.c:9:
/usr/local/pspdev/psp/sdk/include/psputils.h:48: warning: 'struct timezone' declared inside parameter list
/usr/local/pspdev/psp/sdk/include/psputils.h:48: warning: its scope is only this definition or declaration, which is probably not what you want
/usr/local/pspdev/psp/sdk/include/psputils.h:48: warning: 'struct timeval' declared inside parameter list
In file included from /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:65,
                 from lines.c:13:
/usr/local/pspdev/psp/sdk/include/sys/stdio.h:109: error: conflicting types for 'FILE'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:50: error: previous declaration of 'FILE' was here
In file included from lines.c:13:
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:175: error: conflicting types for 'setbuf'
/usr/local/pspdev/psp/sdk/include/sys/stdio.h:152: error: previous declaration of 'setbuf' was here
In file included from lines.c:16:
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/time.h:34: error: redefinition of 'struct tm'
make: *** [lines.o] Error 1


I get this error for most of the samples and also if i try to compile the zlib. But for example the controller demo compiles without this error.

I would be really happy if someone could give me a tip as my head already hurts from constant banging on the table :)


Last edited by mgschwan on Tue May 01, 2007 7:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
StrmnNrmn



Joined: 14 Feb 2007
Posts: 46
Location: London, UK

PostPosted: Tue Apr 17, 2007 8:35 am    Post subject: Re: can't solve "conflicting types Problem" Reply with quote

mgschwan wrote:


Code:

In file included from /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:65,
                 from lines.c:13:
/usr/local/pspdev/psp/sdk/include/sys/stdio.h:109: error: conflicting types for 'FILE'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:50: error: previous declaration of 'FILE' was here
In file included from lines.c:13:
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:175:




I'm not sure about the 'declared inside parameter list' error, but it sounds like your include paths aren't set up right.

lines.c (line13) should just be:

Code:
#include <stdio.h>


but it looks like you have:

Code:
#include <../../../../../psp/include/stdio.h>


So it's pulling in separate definitions - once from

/usr/local/pspdev/psp/sdk/include/sys/stdio.h

and another from:

/usr/local/pspdev/psp/include/stdio.h

It might be helpful if you could post the first dozen or so lines from lines.c and your makefile?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mgschwan



Joined: 17 Apr 2007
Posts: 3

PostPosted: Tue Apr 17, 2007 5:46 pm    Post subject: Reply with quote

Ok here is the Makefile (i used the sample Makefile provided with the lines.c)

Code:

TARGET = lines
OBJS = lines.o ../common/callbacks.o ../common/vram.o
PSPSDK=$(shell psp-config --pspsdk-path)

INCDIR =
CFLAGS = -v -G0 -Wall -O2
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS= -lpspgu

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Lines Sample

include $(PSPSDK)/lib/build.mak


This is the beginning of the lines.c (without the License comments)

Code:

#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>

#include <pspgu.h>

#include "../common/callbacks.h"
#include "../common/vram.h"


And this is the output of make. I added -v as a CFLAG to get more output

Code:

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -v -G0 -Wall -O2 -D_PSP_FW_VERSION=150   -c -o lines.o lines.c
Using built-in specs.
Target: psp
Configured with: ../configure --prefix=/usr/local/pspdev --target=psp --enable-languages=c,c++ --with-newlib --enable-cxx-flags=-G0
Thread model: single
gcc version 4.0.2 (PSPDEV 20051022)
 /usr/local/pspdev/libexec/gcc/psp/4.0.2/cc1 -quiet -v -I. -I/usr/local/pspdev/psp/sdk/include -DPSP=1 -D__psp__=1 -D_PSP=1 -D_PSP_FW_VERSION=150 lines.c -G0 -quiet -dumpbase lines.c -auxbase-strip lines
.o -O2 -Wall -version -o /tmp/ccmfkbnA.s
ignoring nonexistent directory "/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/local/pspdev/psp/sdk/include
 /usr/local/pspdev/lib/gcc/psp/4.0.2/include
 /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include
End of search list.
GNU C version 4.0.2 (PSPDEV 20051022) (psp)
        compiled by GNU C version 4.1.1 (Gentoo 4.1.1).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64372
In file included from /usr/local/pspdev/psp/sdk/include/pspuser.h:26,
                 from /usr/local/pspdev/psp/sdk/include/pspkernel.h:18,
                 from lines.c:9:
/usr/local/pspdev/psp/sdk/include/psputils.h:48: warning: 'struct timezone' declared inside parameter list
/usr/local/pspdev/psp/sdk/include/psputils.h:48: warning: its scope is only this definition or declaration, which is probably not what you want
/usr/local/pspdev/psp/sdk/include/psputils.h:48: warning: 'struct timeval' declared inside parameter list
In file included from /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:65,
                 from lines.c:13:
/usr/local/pspdev/psp/sdk/include/sys/stdio.h:109: error: conflicting types for 'FILE'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:50: error: previous declaration of 'FILE' was here
In file included from lines.c:13:
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h:175: error: conflicting types for 'setbuf'
/usr/local/pspdev/psp/sdk/include/sys/stdio.h:152: error: previous declaration of 'setbuf' was here
In file included from lines.c:16:
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/time.h:34: error: redefinition of 'struct tm'
make: *** [lines.o] Error 1


Thanks in advance for any advice

Greetinge Mike
Back to top
View user's profile Send private message
mgschwan



Joined: 17 Apr 2007
Posts: 3

PostPosted: Tue May 01, 2007 7:45 pm    Post subject: Reply with quote

Well i solved this Problem but i'm not really sure why i solved it.

I deleted the pspdev directory and installed it completely from scratch again (but now into my home directory and not into /usr/local) and i used the -a option with the toolchain command.


Now everything works without an error.

Mike
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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