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

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

Moderators: cheriff, TyRaNiD

Post Reply
mgschwan
Posts: 3
Joined: Tue Apr 17, 2007 4:37 am

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

Post by mgschwan »

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

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.
StrmnNrmn
Posts: 46
Joined: Wed Feb 14, 2007 11:32 pm
Location: London, UK
Contact:

Re: can't solve "conflicting types Problem"

Post by StrmnNrmn »

mgschwan wrote:

Code: Select all

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

#include <stdio.h>
but it looks like you have:

Code: Select all

#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?
mgschwan
Posts: 3
Joined: Tue Apr 17, 2007 4:37 am

Post by mgschwan »

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

Code: Select all

TARGET = lines
OBJS = lines.o ../common/callbacks.o ../common/vram.o
PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;

INCDIR = 
CFLAGS = -v -G0 -Wall -O2
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR = 
LDFLAGS =
LIBS= -lpspgu

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Lines Sample

include $&#40;PSPSDK&#41;/lib/build.mak
This is the beginning of the lines.c (without the License comments)

Code: Select all

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

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&#58; psp
Configured with&#58; ../configure --prefix=/usr/local/pspdev --target=psp --enable-languages=c,c++ --with-newlib --enable-cxx-flags=-G0
Thread model&#58; single
gcc version 4.0.2 &#40;PSPDEV 20051022&#41;
 /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&#58;
#include <...> search starts here&#58;
 .
 /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 &#40;PSPDEV 20051022&#41; &#40;psp&#41;
        compiled by GNU C version 4.1.1 &#40;Gentoo 4.1.1&#41;.
GGC heuristics&#58; --param ggc-min-expand=64 --param ggc-min-heapsize=64372
In file included from /usr/local/pspdev/psp/sdk/include/pspuser.h&#58;26,
                 from /usr/local/pspdev/psp/sdk/include/pspkernel.h&#58;18,
                 from lines.c&#58;9&#58;
/usr/local/pspdev/psp/sdk/include/psputils.h&#58;48&#58; warning&#58; 'struct timezone' declared inside parameter list
/usr/local/pspdev/psp/sdk/include/psputils.h&#58;48&#58; warning&#58; its scope is only this definition or declaration, which is probably not what you want
/usr/local/pspdev/psp/sdk/include/psputils.h&#58;48&#58; warning&#58; 'struct timeval' declared inside parameter list
In file included from /usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h&#58;65,
                 from lines.c&#58;13&#58;
/usr/local/pspdev/psp/sdk/include/sys/stdio.h&#58;109&#58; error&#58; conflicting types for 'FILE'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h&#58;50&#58; error&#58; previous declaration of 'FILE' was here
In file included from lines.c&#58;13&#58;
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/stdio.h&#58;175&#58; error&#58; conflicting types for 'setbuf'
/usr/local/pspdev/psp/sdk/include/sys/stdio.h&#58;152&#58; error&#58; previous declaration of 'setbuf' was here
In file included from lines.c&#58;16&#58;
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/include/time.h&#58;34&#58; error&#58; redefinition of 'struct tm'
make&#58; *** &#91;lines.o&#93; Error 1
Thanks in advance for any advice

Greetinge Mike
mgschwan
Posts: 3
Joined: Tue Apr 17, 2007 4:37 am

Post by mgschwan »

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