Problems with minPsp and eclipse

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

Moderators: cheriff, TyRaNiD

Post Reply
sicga
Posts: 4
Joined: Tue Feb 10, 2009 10:31 pm

Problems with minPsp and eclipse

Post by sicga »

Hi

I'm trying to put an image on the screen, nothing fancy but the project won't run, first off it highlighs a lot of the include headers and states that it is 'unresolved inclusion' and secondly when I click on run it fails with 'binary not found'.

Can anyone help? Is is because the toolchain hasn't loaded correctly. I've been messing about with this for ages and am having no luck. Any assistance would be greatyl appreciated.

Thanks
kuroneko
Posts: 24
Joined: Thu Dec 08, 2005 11:32 am
Location: Chigasaki, Japan

Re: Problems with minPsp and eclipse

Post by kuroneko »

sicga wrote:... first off it highlighs a lot of the include headers and states that it is 'unresolved inclusion' and secondly when I click on run it fails with 'binary not found'.
Eclipse expects the toolchain binaries to be "in the path". Are they available from the command line?
sicga
Posts: 4
Joined: Tue Feb 10, 2009 10:31 pm

Post by sicga »

As far as I'm aware they would be in the command line, how would I check, would I have to go into PSPdev or the MinGw set up?

Thanks for your help.
User avatar
Oguz286
Posts: 35
Joined: Tue Oct 30, 2007 4:56 am

Post by Oguz286 »

As blackcat suggested, you should check if the binaries are in your path. To do that open up a command window (if you're using windows). Start->Run Command. Type in cmd and press enter. Type in 'psp-gcc' and check if it says no input files or something like that. If so, then everything should be set up correctly.

But maybe it's easier to follow the "PSP Development with Eclipse" article on http://minpspw.sourceforge.net/ (which is what I'm using and it works like a charm).
Setting up pspsdk on ubuntu and upcoming tutorials: http://www.guztech.nl
sicga
Posts: 4
Joined: Tue Feb 10, 2009 10:31 pm

Post by sicga »

HI

Thanks for that information. Everything seems to be set up ok. I downloaded the article on how to set up and did everything written down but was still unable to launch the program, which at least was a step further but now it has gone back to not recognising the header files and missing the binaries. I have a later version than that shown in the article and it wasn't possible to do all the steps because certain boxes that needed ticking weren't there. I've looked for these headers - such as pspdisplay.h and I can't find them anywhere. Is there somewhere where I can download a copy of the toolchain for minpsp (it was supposed to be in the SDK but it may not have been complete)? I've been at this for a week so far and am getting nowhere. Any help would be appreciated.
kuroneko
Posts: 24
Joined: Thu Dec 08, 2005 11:32 am
Location: Chigasaki, Japan

Re: Problems with minPsp and eclipse

Post by kuroneko »

sicga wrote:... secondly when I click on run it fails with 'binary not found'.
Having thought about this, there is no point Run(ning) the PSP binary on your PC. This error - IIRC - results from launch shortcut creation which tries to find a type of executable suitable for your eclipse platform (e.g. win32 -> *.exe). I'm not familiar with this particular setup but I think the PSP toolchain links into ELF (eclipse can recognise ELF's as binary but they would only run on the real target).

Does compilation work?

I'll have a look at the stuff Oguz286 referred to and see if I can reproduce it.

[Later ...]

OK, so I installed the 0.8.11 SDK and simply followed the instructions outlined in PSP Development with Eclipse. And it just works.

Initially - i.e. before the first build - all include files in the outline view will have a warning attached. After the build, once the scanner info builder ran, most of them change to normal.

However, system includes which live under libs stay marked because the compiler only reports psp/sdk/include as a system path (which means that the outline view can't verify the libc/*.h). The compiler itself knows about them so you can use functions defined in there without problems. If you want to get rid of the markers you'll have to use e.g.

Code: Select all

#include <libc/string.h>
or add the extra search path manually.

Also, the cube example mentioned in the guide refers to <math.h> which doesn't exist, but as it isn't used it doesn't matter.

HTH
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

One more thing, you cannot run your app directly from Eclipse (this is expected), since you are cross compiling an app from a MIPS CPU while your PC runs on a Intel CPU.

The Cross compiler will generate a Elf binary which doesn't run on windows (except you have a emulator).

You can code, compile and use the psplink to upload and run your app and that can be achieved using custom tools the red toolbox icon on eclipse, but not the standard green run button.
sicga
Posts: 4
Joined: Tue Feb 10, 2009 10:31 pm

Post by sicga »

HI

Thanks for that information, I am getting further. I do have an emulator(MinGW I think). Now I am getting stuck on the makefile. I don't really know anything about makefiles and I copied a working one on the hello worl program sample, changing the names where appropriate. My makefile looks like this

make:
all: moon.exe

clean:
rm lunar.o moon.exe

moon.exe: lunar.o
g++ -g -o moon lunar.o

lunar.o
g++ -c -g lunar.c


The error I get is that there is no seperator at line 5. 'moon' is the name of the project and 'lunar' is the 'c' file. Anyone have any idea what this seperator is?

I must admit makefiles are unfamiliar to me and I don't really know how to put one together. Any advice would be greatly appreciated.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

MinGW is not an emulator but a framework to let gcc (the compiler on wich pspsdk is heavily based) be suitable under windows (now you can use Heimdall's). We meant a PSP emulator, and even if you had a working one (it doesn't exist a full working PSP emulator) chanches are small that it comes ready for use under eclipse. The easier procedure to write and test an homebrew is:
1) write it however you like
2) compile it issuing "make" at command prompt while in your sources' path
3) copy generated EBOOT.PBP under game/[your_app_name]
4) launch app under PSP

Once you get fluent in programming and the transfer between PC and PSP becomes the bottleneck in your dev days, then start considering PSPLink.
kuroneko
Posts: 24
Joined: Thu Dec 08, 2005 11:32 am
Location: Chigasaki, Japan

Post by kuroneko »

sicga wrote:The error I get is that there is no seperator at line 5. 'moon' is the name of the project and 'lunar' is the 'c' file. Anyone have any idea what this seperator is?
A separator is e.g. a TAB character (don't know if make accepts SPACES, never tried), i.e. commands associated with a target can't start at the beginning of the line, you have to indent them, e.g.

clean:
<TAB>rm -f lunar.o moon.exe
ITDemo
Posts: 20
Joined: Sat Nov 17, 2007 8:08 am

Post by ITDemo »

To be honest I think you should just visit psp-programming.com before going any futher and follow the tutorials on that site.
Post Reply