It states that png.h is missing but when i copy that into my directory it gives al sorts of duplicate errors
what can i do to get it to work in Visual C++ (microsoft)
P.S. i have posted a sortwise post already but i posted it into a wrong thread it was a thread which i said was solved allready so sorry for the kind of doublepost.
Your include path is set to look in the current directory and in /usr/local/pspdev/psp/sdk/include. If you have compiled and installed libpng the normal way, png.h will be installed in /usr/local/pspdev/psp/include.
So modify your makefile or however that is done in Visual Studio, to add that directory to your include path also.
Compilatie van het Project.
bin2o -i ball.raw ball.o ball
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/pspdev/psp/sdk/lib framebuffer.c graphics.c main.c ball.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_
apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o out.elf
graphics.c:5:17: error: png.h: No such file or directory
graphics.c:51: error: syntax error before 'png_ptr'
graphics.c: In function 'loadImage':
graphics.c:57: error: 'png_structp' undeclared (first use in this function)
graphics.c:57: error: (Each undeclared identifier is reported only once
graphics.c:57: error: for each function it appears in.)
graphics.c:57: error: syntax error before 'png_ptr'
graphics.c:58: error: 'png_infop' undeclared (first use in this function)
graphics.c:60: error: 'png_uint_32' undeclared (first use in this function)
graphics.c:60: error: syntax error before 'width'
graphics.c:63: error: 'FILE' undeclared (first use in this function)
graphics.c:63: error: 'fp' undeclared (first use in this function)
graphics.c:67: warning: implicit declaration of function 'fopen'
graphics.c:68: error: 'png_ptr' undeclared (first use in this function)
graphics.c:68: warning: implicit declaration of function 'png_create_read_struct'
graphics.c:68: error: 'PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
graphics.c:71: warning: implicit declaration of function 'fclose'
graphics.c:74: warning: implicit declaration of function 'png_set_error_fn'
graphics.c:74: error: 'png_voidp' undeclared (first use in this function)
graphics.c:74: error: 'png_error_ptr' undeclared (first use in this function)
graphics.c:75: error: 'info_ptr' undeclared (first use in this function)
graphics.c:75: warning: implicit declaration of function 'png_create_info_struct'
graphics.c:79: warning: implicit declaration of function 'png_destroy_read_struct'
graphics.c:79: error: 'png_infopp_NULL' undeclared (first use in this function)
graphics.c:82: warning: implicit declaration of function 'png_init_io'
graphics.c:83: warning: implicit declaration of function 'png_set_sig_bytes'
graphics.c:84: warning: implicit declaration of function 'png_read_info'
graphics.c:85: warning: implicit declaration of function 'png_get_IHDR'
graphics.c:85: error: 'width' undeclared (first use in this function)
graphics.c:85: error: 'height' undeclared (first use in this function)
graphics.c:85: error: 'int_p_NULL' undeclared (first use in this function)
graphics.c:96: warning: implicit declaration of function 'png_set_strip_16'
graphics.c:97: warning: implicit declaration of function 'png_set_packing'
graphics.c:98: error: 'PNG_COLOR_TYPE_PALETTE' undeclared (first use in this function)
graphics.c:98: warning: implicit declaration of function 'png_set_palette_to_rgb'
graphics.c:99: error: 'PNG_COLOR_TYPE_GRAY' undeclared (first use in this function)
graphics.c:99: warning: implicit declaration of function 'png_set_gray_1_2_4_to_8'
graphics.c:100: warning: implicit declaration of function 'png_get_valid'
graphics.c:100: error: 'PNG_INFO_tRNS' undeclared (first use in this function)
graphics.c:100: warning: implicit declaration of function 'png_set_tRNS_to_alpha'
graphics.c:101: warning: implicit declaration of function 'png_set_filler'
graphics.c:101: error: 'PNG_FILLER_AFTER' undeclared (first use in this function)
graphics.c:118: warning: implicit declaration of function 'png_read_row'
graphics.c:118: error: 'png_bytep_NULL' undeclared (first use in this function)
graphics.c:125: warning: implicit declaration of function 'png_read_end'
graphics.c: In function 'createImage':
graphics.c:216: warning: implicit declaration of function 'memset'
graphics.c:216: warning: incompatible implicit declaration of built-in function 'memset'
graphics.c: In function 'printTextScreen':
graphics.c:296: warning: implicit declaration of function 'strlen'
graphics.c:296: warning: incompatible implicit declaration of built-in function 'strlen'
graphics.c: In function 'printTextImage':
graphics.c:323: warning: incompatible implicit declaration of built-in function 'strlen'
graphics.c: In function 'saveImage':
graphics.c:343: error: 'png_structp' undeclared (first use in this function)
graphics.c:343: error: syntax error before 'png_ptr'
graphics.c:344: error: 'png_infop' undeclared (first use in this function)
graphics.c:345: error: 'FILE' undeclared (first use in this function)
graphics.c:345: error: 'fp' undeclared (first use in this function)
graphics.c:350: error: 'png_ptr' undeclared (first use in this function)
graphics.c:350: warning: implicit declaration of function 'png_create_write_struct'
graphics.c:350: error: 'PNG_LIBPNG_VER_STRING' undeclared (first use in this function)
graphics.c:352: error: 'info_ptr' undeclared (first use in this function)
graphics.c:354: warning: implicit declaration of function 'png_destroy_write_struct'
graphics.c:354: error: 'png_infopp' undeclared (first use in this function)
graphics.c:358: warning: implicit declaration of function 'png_set_IHDR'
graphics.c:359: error: 'PNG_COLOR_TYPE_RGBA' undeclared (first use in this function)
graphics.c:359: error: 'PNG_COLOR_TYPE_RGB' undeclared (first use in this function)
graphics.c:360: error: 'PNG_INTERLACE_NONE' undeclared (first use in this function)
graphics.c:360: error: 'PNG_COMPRESSION_TYPE_DEFAULT' undeclared (first use in this function)
graphics.c:360: error: 'PNG_FILTER_TYPE_DEFAULT' undeclared (first use in this function)
graphics.c:361: warning: implicit declaration of function 'png_write_info'
graphics.c:375: warning: implicit declaration of function 'png_write_row'
graphics.c:378: warning: implicit declaration of function 'png_write_end'
main.c:30:17: error: png.h: No such file or directory
main.c: In function 'CallbackThread':
main.c:86: warning: passing argument 2 of 'sceKernelCreateCallback' from incompatible pointer type
main.c: In function 'SetupCallbacks':
main.c:99: warning: passing argument 2 of 'sceKernelCreateThread' from incompatible pointer type
make: *** [out.elf] Error 1
Effacer les fichiers inutiles
Trouver le bon repertoire
Création du PBP
Er bestaat al een submap of bestand .\GAME2%.
Creation du PBP terminée -> filesize : 00015345
Renommer en EBOOT.PBP
Er bestaat al een submap of bestand .\GAME2.
Het systeem kan het opgegeven bestand niet vinden.
Error executing c:\windows\system32\cmd.exe.
EBOOT.PBP - 41 error(s), 32 warning(s)
[/quote] I have installed the zlib and the libpng in Cygwin BTW do i have to install them also in Visual C++ ?
graphics.c:5:17: error: png.h: No such file or directory
In a C or C++ program, always look at the first error. The compiler still isn't finding the png.h header file. You can set a path to search for include files right in your batch file. Just add something like the following to set an include path before you run make.exe:
set include=c:\pspdev\include;c:\pspdev\psp\include;c:\pspdev\psp\sdk\include;
You must change this line to match the configuration of your machine, just use semicolons ';' between directory names.
@REM Ne pas afficher les commandes
@ECHO OFF
ECHO Compilatie van het Project.
SET path=%path%;C:\cygwin\bin;C:\cygwin\usr/local/pspdev/bin
SET PSPSDK=C:\cygwin\usr/local/pspdev
set include=C:\cygwin\usr\include;C:\cygwin\usr\include\libpng12
make.exe
ECHO Effacer les fichiers inutiles
DEL *.o
ECHO Trouver le bon repertoire
SET DRIVE=.\
ECHO Création du PBP
MD %DRIVE%GAME2%%
Elf2pbpm -FILEOUT=%DRIVE%GAME2%%\EBOOT.PBP -TITLE="Game 2: 2D"
ECHO Renommer en EBOOT.PBP
MD %DRIVE%GAME2
MOVE out.elf %DRIVE%GAME2\EBOOT.PBP
C:\cygwin\usr\include\libpng12 <--- in here the png.h exists
C:\cygwin\usr\include <--- in here a shortcut exists to png.h
i still get the same errors
I tried just copying the png.h and the pngconf.h to my sourcecode folder but then i get these errors:
@REM Ne pas afficher les commandes
@ECHO OFF
ECHO Compilatie van het Project.
SET path=%path%;C:\cygwin\bin;C:\cygwin\usr/local/pspdev/bin
SET PSPSDK=C:\cygwin\usr/local/pspdev
set include=C:\cygwin\usr\include;C:\cygwin\usr\include\libpng12
make.exe
ECHO Effacer les fichiers inutiles
DEL *.o
ECHO Trouver le bon repertoire
SET DRIVE=.\
ECHO Création du PBP
MD %DRIVE%GAME2%%
Elf2pbpm -FILEOUT=%DRIVE%GAME2%%\EBOOT.PBP -TITLE="Game 2: 2D"
ECHO Renommer en EBOOT.PBP
MD %DRIVE%GAME2
MOVE out.elf %DRIVE%GAME2\EBOOT.PBP
C:\cygwin\usr\include\libpng12 <--- in here the png.h exists
C:\cygwin\usr\include <--- in here a shortcut exists to png.h
i still get the same errors
I tried just copying the png.h and the pngconf.h to my sourcecode folder but then i get these errors:
I reinstalled it didn't work, then rereinstalled it and now i don't get any errors anymore about the png.h BUT now i get duplicate errors??? (i also changed the includepath you gave me)
bin2o -i ball.raw ball.o ball
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o graphics.o graphics.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o framebuffer.o framebuffer.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/pspdev/psp/sdk/lib framebuffer.c graphics.c main.c ball.o graphics.o framebuffer.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspne
t -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o out.elf
main.c: In function 'CallbackThread':
main.c:85: warning: passing argument 2 of 'sceKernelCreateCallback' from incompatible pointer type
main.c: In function 'SetupCallbacks':
main.c:98: warning: passing argument 2 of 'sceKernelCreateThread' from incompatible pointer type
graphics.o: In function `getVramDrawBuffer':
graphics.c:(.text+0x4c): multiple definition of `getVramDrawBuffer'
/cygdrive/c/DOCUME~1/Reinier/LOCALS~1/Temp/ccqiBpCF.o:graphics.c:(.text+0x4c): first defined here
graphics.o: In function `getVramDisplayBuffer':
graphics.c:(.text+0x74): multiple definition of `getVramDisplayBuffer'
/cygdrive/c/DOCUME~1/Reinier/LOCALS~1/Temp/ccqiBpCF.o:graphics.c:(.text+0x74): first defined here
graphics.o: In function `user_warning_fn':
graphics.c:(.text+0xa8): multiple definition of `user_warning_fn'
/cygdrive/c/DOCUME~1/Reinier/LOCALS~1/Temp/ccqiBpCF.o:graphics.c:(.text+0xa8): first defined here
graphics.o: In function `loadImage':
graphics.c:(.text+0xb0): multiple definition of `loadImage'
I reinstalled it didn't work, then rereinstalled it and now i don't get any errors anymore about the png.h BUT now i get duplicate errors??? (i also changed the includepath you gave me)
bin2o -i ball.raw ball.o ball
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o graphics.o graphics.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o framebuffer.o framebuffer.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/pspdev/psp/sdk/lib framebuffer.c graphics.c main.c ball.o graphics.o framebuffer.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspne
t -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o out.elf
main.c: In function 'CallbackThread':
main.c:85: warning: passing argument 2 of 'sceKernelCreateCallback' from incompatible pointer type
main.c: In function 'SetupCallbacks':
main.c:98: warning: passing argument 2 of 'sceKernelCreateThread' from incompatible pointer type
graphics.o: In function `getVramDrawBuffer':
graphics.c:(.text+0x4c): multiple definition of `getVramDrawBuffer'
/cygdrive/c/DOCUME~1/Reinier/LOCALS~1/Temp/ccqiBpCF.o:graphics.c:(.text+0x4c): first defined here
graphics.o: In function `getVramDisplayBuffer':
graphics.c:(.text+0x74): multiple definition of `getVramDisplayBuffer'
/cygdrive/c/DOCUME~1/Reinier/LOCALS~1/Temp/ccqiBpCF.o:graphics.c:(.text+0x74): first defined here
graphics.o: In function `user_warning_fn':
graphics.c:(.text+0xa8): multiple definition of `user_warning_fn'
/cygdrive/c/DOCUME~1/Reinier/LOCALS~1/Temp/ccqiBpCF.o:graphics.c:(.text+0xa8): first defined here
graphics.o: In function `loadImage':
graphics.c:(.text+0xb0): multiple definition of `loadImage'
Is there something wrong with my computer?
Now the zlib and libpng are installed fine.
For the multiple definition, check your makefile and source if you compile same file several times or if you declare several times the same function.