 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Pihas
Joined: 25 Oct 2008 Posts: 60 Location: Lithuania
|
Posted: Sat Mar 14, 2009 8:36 pm Post subject: [Solved] MingGW (error: graphics.h: No such file or dir) |
|
|
Hello every body i'm new at C++ programing and have a problem with simple thing :/ just want to blit an Image. Made Hellow World and works perfectly but with image bliting have problems.
I'm using DevkitPro (http://www.devkitpro.org) with installed pspsdk-setup-0.9.2.exe (http://minpspw.sourceforge.net/)
Console:
| Code: | Owner@PRIVE-0D6D31055 ~/Projektai
$ cd Paveiksliukas
Owner@PRIVE-0D6D31055 ~/Projektai/Paveiksliukas
$ make
psp-gcc -I. -Ic:/devkitPro/devkitPSP/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP
_FW_VERSION=150 -c -o main.o main.c
main.c:17:22: error: graphics.h: No such file or directory
main.c: In function 'main':
main.c:60: error: 'Image' undeclared (first use in this function)
main.c:60: error: (Each undeclared identifier is reported only once
main.c:60: error: for each function it appears in.)
main.c:60: error: 'ourImage' undeclared (first use in this function)
main.c:64: warning: implicit declaration of function 'initGraphics'
main.c:67: warning: implicit declaration of function 'loadImage'
main.c:82: warning: implicit declaration of function 'blitAlphaImageToScreen'
main.c:90: warning: implicit declaration of function 'flipScreen'
make: *** [main.o] Error 1
Owner@PRIVE-0D6D31055 ~/Projektai/Paveiksliukas
$ |
My main.c:
| Code: | /*
My Image Display Program
Author: Brad Dwyer
Date: 12/28/2005
Thanks to Psilocybeing for the base code.
*/
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "graphics.h"
#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
PSP_MODULE_INFO("Image Display Program", 0, 1, 1);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main() {
char buffer[200];
Image* ourImage;
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
sprintf(buffer, "bootlog.png");
ourImage = loadImage(buffer);
if (!ourImage) {
//Image load failed
printf("Image load failed!\n");
} else {
int x = 0;
int y = 0;
sceDisplayWaitVblankStart();
while (x < 480) {
while (y < 272) {
blitAlphaImageToScreen(0 ,0 ,32 , 32, ourImage, x, y);
y += 32;
}
x += 32;
y = 0;
}
flipScreen();
}
sceKernelSleepThread();
return 0;
}
|
My make file:
| Code: | TARGET = hello
OBJS = main.o graphics.o framebuffer.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspgu -lpng -lz -lm
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Image Example
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak |
It think my problem is that did't installed (compiled) zlib, if it is how to do what on MinGW. Tried to use Minimalist PSPSDK for Windows: http://sourceforge.net/project/showfiles.php?group_id=223830&package_id=271000&release_id=590671 zlib-1.2.2-pspdevpak.exe
Last edited by Pihas on Sat Mar 14, 2009 11:07 pm; edited 1 time in total |
|
| Back to top |
|
 |
Pihas
Joined: 25 Oct 2008 Posts: 60 Location: Lithuania
|
Posted: Sat Mar 14, 2009 8:37 pm Post subject: Re: MingGW (error: graphics.h: No such file or dir) |
|
|
| Sry for double posting, just press edit button...to add devkit version (1.4.10) |
|
| Back to top |
|
 |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
Posted: Sat Mar 14, 2009 9:33 pm Post subject: |
|
|
| the minpspw 0.9.2 already comes with zlib and other included and you don't need devkitpro at all. The other thing is that graphics.h is not part of the sdk it comes (i think) from the tutorials from the psp-hacks book and site, maybe you should look for it there... |
|
| Back to top |
|
 |
Pihas
Joined: 25 Oct 2008 Posts: 60 Location: Lithuania
|
|
| Back to top |
|
 |
|
|
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
|