C/C++ Programming Help Thread
This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Zitat von Davee You need to setup your enviroment variables before you start installing. I don't understand that. Can you ...
-
12-10-2008, 06:31 AM #9301QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
-
12-10-2008, 12:45 PM #9302QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
cygwin runs perfectly fine on vista
as for environment variables, see the toolchain readme1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
12-11-2008, 08:17 AM #9303QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
Oke. Thanks for the answer, I will try it out again;)
-
12-11-2008, 07:10 PM #9304Bush Programmer

- Registriert seit
- Nov 2005
- Beiträge
- 3.658
- Points
- 60.149
- Level
- 100
- Downloads
- 0
- Uploads
- 0
Hi Guys,
Looking for a simple example of collision detection in GU.
(ie. pixel resolution collision detection between two objects or finding the colour of a pixel at given coordinates).
Thanks, Art.Geändert von Art (12-12-2008 um 01:41 AM Uhr)
-
12-12-2008, 08:20 AM #9305QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
It's 3.15, I'm tired and this code doesn't seem to be working.
I'm reading the contents of ms0:/MUSIC/. fileCount is the amount of files in the folder. The musicFiles struct holds filename and ID, nothing else. It reads fine, without crashing, when I display the filenames that are stored afterwards, they all show up the same eg. all filenames are the same file. Help would be awesome, I'm gonna go sleep...Code:for(fileCompare = 0; fileCompare < fileCount; fileCompare ++) { sceIoDread(dirId, &dirent); sprintf(musicFiles[fileCompare].filename, dirent.d_name); musicFiles[fileCompare].ID = fileCompare; }
Edit: Fixed. Stupid error on my behalfGeändert von Xsjado7 (12-12-2008 um 06:07 PM Uhr)
-
12-12-2008, 11:27 AM #9306QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
"error: expected unqualified-id before 'asm'" when compiling
Hi,
this is the first time I try to compile a C++ program, before that I only did C (for 1.5 kernel), and now I have troubles; When I compile I get an error saying
Line 24 is PSP_MODULE_INFO("pspProje ct", PSP_MODULE_USER, 1, 1);main.cpp (24) : error: expected unqualified-id before 'asm'
before that I include a file "Renderer.h", if I don't the error does not occur. Renderer.h is pretty simple:
So I guess the error must be found somewhere else, but I have no idea where. Maybe in the Makefile?Code:class Renderer { public: void render_screen(); void flip_screen(); void remove_layer(int layer_id); void flush_layers(); }
Spoiler for Makefile:
Thanks for all answers
Luke
-
12-12-2008, 12:58 PM #9307
you lack trailing semi colon to close the class off.
-- Code Monkey : Sarien, Fishguts, Cracks and Crevices --
"Did IQ's just drop sharply while I was away?" (Ripley)
-
12-12-2008, 01:30 PM #9308QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
-_-
too much java lately *dies*
Thank you!
-
12-13-2008, 08:37 AM #9309QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
lists on the PSP
Ok, more noob-questions, sorry for that;
I'm trying to create a simple list with the stl, but I get the error
Renderer.h (12) : error: ISO C++ forbids declaration of 'list' with no type
Code is simple:
I can cut out the #include <list> and get the same messages, somehow this doesn't seem to be recognized.Code:#include <list> #include "GuiObject.h" class Renderer { private: list<GuiObject> gui_objects; // <= Line 12 // other code };
Sorry for noobing around
Luke
-
12-13-2008, 03:08 PM #9310QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
The STL type list is under the namespace std, so if you want to use it you can do one of the following things:
orCode:using namespace std; ... list<SomeType> myList;
Code:std::list<SomeType> myList;
-
12-14-2008, 05:39 AM #9311QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
thx!
-
12-14-2008, 04:21 PM #9312
Suddenly I was wondering if,
char *text;
//malloc blah blah
Are these both interchangeable?
Can we use either of these?
text[5];
*(text+5) (or is Only this valid?)
-
12-14-2008, 05:02 PM #9313
- Registriert seit
- May 2008
- Beiträge
- 46
- Points
- 2.561
- Level
- 30
- Downloads
- 0
- Uploads
- 0
-
12-14-2008, 05:15 PM #9314
-
12-14-2008, 06:05 PM #9315QJ Gamer Bronze
- Registriert seit
- Aug 2008
- Ort
- thugz mansion
- Beiträge
- 875
- Points
- 5.594
- Level
- 48
- Downloads
- 0
- Uploads
- 0
just a question but did the allegro engine get ported to the psp http://www.allegro.cc
made game making in c alot more easy.
Zitat von SuperBatXS
-
12-15-2008, 08:57 AM #9316Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
To my knowledge it hasnt been ported. It should be portable though as it is a wrapper for SDL.
-
12-15-2008, 09:36 AM #9317
allegro has nothing to do with sdl. it does not wrap sdl.
my understanding is that it has already been ported by diedel (check ps2dev.org)
see here http://diedel.blogcindario.com/-- Code Monkey : Sarien, Fishguts, Cracks and Crevices --
"Did IQ's just drop sharply while I was away?" (Ripley)
-
12-15-2008, 02:20 PM #9318I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I've started compiling some stuff I've made recently, but I've come across some issues.
First, when I tried compiling freetype it gives me an error with toolize, I've searched Google but can't find anything of use. I'm on Ubuntu Fiesty.
Second, I've written a module and the exports, but I'm getting a warning "cannot find entry symbol module_start; defaulting to 0000...."
Spoiler for Src, export, makefile:
Third - solved
Finally, I today updated to 5.00 after being on 3.52 forever, I was wondering if there was still the development libraries to take advantage of M33 available like on the older cfws?
Sorry for the long winded post, but I can't find any answers elsewhere.
-AuraGeändert von Auraomega (12-15-2008 um 02:32 PM Uhr)
-
12-16-2008, 06:23 AM #9319QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
How do I find out wether or not a given filename (respectively path) is a folder or not? I found out for Linux there's S_ISDIR, but I can't figure out how to use it -_-. Does anyone have a good link or something?
-
12-16-2008, 07:36 AM #9320
its called 'stat'.
then call S_ISDIR on the st_mode entry from the stat buffer...Code:int stat(char *path, struct stat *buf);
-- Code Monkey : Sarien, Fishguts, Cracks and Crevices --
"Did IQ's just drop sharply while I was away?" (Ripley)
-
12-16-2008, 08:02 AM #9321
- Registriert seit
- May 2007
- Beiträge
- 31
- Points
- 3.340
- Level
- 35
- Downloads
- 0
- Uploads
- 0
Hi there,
is there any way to downscale a png image while using graphics.h.
found this function Image* imageThumbnail(Image* inImage) in another graphic.s c by flatmush. Did anybody ever used this function?
Need to downscale some png images around 30%.
Thanks in advance.
-
12-16-2008, 09:36 PM #9322QJ Gamer Green
- Registriert seit
- Apr 2008
- Ort
- in a hobbit hole
- Beiträge
- 67
- Points
- 6.366
- Level
- 52
- Downloads
- 0
- Uploads
- 0
:/
Geändert von RupertAvery (12-16-2008 um 10:52 PM Uhr)
-
12-17-2008, 05:50 AM #9323QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- Germany
- Beiträge
- 216
- Points
- 4.511
- Level
- 42
- Downloads
- 0
- Uploads
- 0
-
12-17-2008, 02:22 PM #9324QJ Gamer Blue
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 26
- Points
- 2.426
- Level
- 29
- Downloads
- 0
- Uploads
- 0
I keep on getting errors with the SCEMP3 sample from the SDK. I keep on getting the loading music error (yes, the directory and everything is in the right spot). Does anyone have a working SCEMP3 sample (or something similar)
-
12-17-2008, 07:48 PM #9325QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
If your getting an error at sceMp3Init( handle ) then your MP3 most likely has ID3 tag which sceMp3 cannot parse. You have to find your own way around it then pass the data back
-
12-17-2008, 08:23 PM #9326xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Backgroung
hi,
im currently making a app for psp
i need to know how to get the Mobo info,
also i cant blit a background brhind text.
Thx in advncd :Punk:
-
12-17-2008, 08:35 PM #9327QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
-
12-17-2008, 08:48 PM #9328Developer

- Registriert seit
- Oct 2005
- Ort
- Dubuque
- Beiträge
- 423
- Points
- 12.154
- Level
- 72
- My Mood
-
- Downloads
- 1
- Uploads
- 0
-
12-17-2008, 11:08 PM #9329xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
yep
yea thx guys i fixed the prob with the blit!! :Jump:
i still need to get the MotherBoard info plz.
Also i need to read a key from IdStorage
but my compiler returns:Code:int ReadKey(int key, char *buffer) { int err; u32 k1; k1 = pspSdkSetK1(0); memset(buffer, 0, 512); err = sceIdStorageReadLeaf(key, buffer); pspSdkSetK1(k1); return err; }
plz help, thx in advncd :Punk:Code:main.c:(.text+0x120): undefined reference to `sceIdStorageReadLeaf'
--EDIT--
The code is also a prx because if im not mistaken this code has to be run in kernel mode right?Geändert von slasher101 (12-17-2008 um 11:10 PM Uhr) Grund: MORE INFO
-
12-17-2008, 11:11 PM #9330QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
Your missing a lib from you makefile. Not sure which one though
Edit:
Try - lpspidstorage


LinkBack URL
About LinkBacks
Mit Zitat antworten


Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum