How to compile, link and transfer PSP programs from VS.NET

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

Moderators: cheriff, TyRaNiD

RetroGamer
Posts: 11
Joined: Tue Nov 07, 2006 10:44 am

Post by RetroGamer »

I followed the instructions word by word, and I get this error message in Visual Studio:

"
/vs-pspdev.sh: line 4: cd: /cygdrive/c/Program Files/Microsoft Visual Studio/MyProjects/RPG Engine/14 PSPDEV/PSPDEV: No such file or directory
make: *** No targets specified and no makefile found. Stop.
"

That is a directory on my hard drive and there is a makefile under the PSPDEV directory. I don't know why it isn't finding anything.
Riekistyx
Posts: 14
Joined: Sat Mar 18, 2006 9:56 am

Post by Riekistyx »

Warren wrote:I came up with a better solution tonight that doesn't require you to add anything to visual studio or change your makefiles. Just make the following scripts to your c:\cygwin directory and modify paths as needed:

vs-pspdev.bat

Code: Select all

@c:\cygwin\bin\bash -c 'export VS_PATH=`pwd`; /bin/bash --login -c "/vs-pspdev.sh %1 %2 %3 %4 %5"'
vs-pspdev.sh

Code: Select all

#!/bin/bash
export PSP_MOUNT=/cygdrive/i
export PATH=$PATH:/cygdrive/p/pspdev/bin
cd "$VS_PATH"
make 2>&1 $@ | sed -e 's/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/' 
Then in VS, make a new makefile project and specify "c:\cygwin\vs-pspdev.bat "as make command, "c:\cygwin\vs-pspdev.bat clean" as clean command and "c:\cygwin\vs-pspdev.bat clean all" as rebuild and voila, you're rocking in VS.net with minimal fuss.

here is what i have in my output window
cygwin is on my D drive

here is my batch file

Code: Select all

@d:\cygwin\bin\bash -c 'export VS_PATH=`pwd`; /bin/bash --login -c "/vs-pspdev.sh %1 %2 %3 %4 %5"'
here is that sh file thing

Code: Select all

#!/bin/bash
export PSP_MOUNT=/cygdrive/i
export PATH=$PATH:/cygdrive/p/pspdev/bin
cd "$VS_PATH"
make 2>&1 $@ | sed -e 's/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/'


Output window gives me this
Performing Makefile project actions
/vs-pspdev.sh: line 4: cd: /cygdrive/d/Documents/Visual Studio/Vs2003/Psptest/psptest: No such file or directory
make: *** No targets specified and no makefile found. Stop.

How do I do this lol.... I'm a idiot....
now.. in this nmake project is it possible to add "include directories to the project?"
because i have visual assist. it will show up function parameters and comments in the psp sdk... but if i add pspsdk (to my includes) and point it out as a include for global all other projects bitch at all the linux specific stuff in the code.

Please help me. I want to do more than hello world but i want to do it with ease. =o
LOL @ linux users
StrmnNrmn
Posts: 46
Joined: Wed Feb 14, 2007 11:32 pm
Location: London, UK
Contact:

Post by StrmnNrmn »

Riekistyx wrote: Output window gives me this
Performing Makefile project actions
/vs-pspdev.sh: line 4: cd: /cygdrive/d/Documents/Visual Studio/Vs2003/Psptest/psptest: No such file or directory
make: *** No targets specified and no makefile found. Stop.
You've probably solved this by now. I've spent the last two hours banging my head off my keyboard with the same issue so I thought I'd share in case anyone else has the same issue.

Basically check that your line endings are Unix-stylee (i.e. just LF) in whichever text editor you're using. I copied and pasted the text from this forum and it seems cd was treating the trailing carriage return char as a part of the path. Resaving the script after normalising the line endings sorted it for me.

It's crazy that we still have to waste time with stuff like this in 2007...

-StrmnNrmn
Overseer
Posts: 3
Joined: Tue Nov 13, 2007 11:56 pm

Post by Overseer »

I've been trying to get this to work myself. I've been doing alright with the cygwin method, but I'm a pretty big fan of .NET since I use it at the office and am familiar with it, but if I have to go back to EditPlus, then so be it.

Anyway, I've figured it out until the point where I go to build. I get errors that, when I looked them up, seem to be syntax errors in the SDK. For example:

Code: Select all

error C2086: 'int __inline__' : redefinition    C:\cygwin\usr\local\pspdev\psp\sdk\include\psptypes.h(68) : see declaration of '__inline__'
In C++, it's true, that is invalid. But in C, this is okay. Basically, I can't figure out how to mix C++((which is what my main code is written in)) and C in VC++.NET 2003.

If anyone could point me in the right direction, I would greatly appreciate it.

Thanks,
CR
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

I don't get it, what's that error coming from? That doesn't look like a gcc error. Are you trying to compile PSP programs with MSVC?
Overseer
Posts: 3
Joined: Tue Nov 13, 2007 11:56 pm

Post by Overseer »

Ha, yeah that's not what I was trying to do, but I guess I didn't realize that that was what the IDE was trying to do. As soon as I read that I checked that angle. Went through the process again and this time I was able to get it to work more in the right direction, though now I'm getting this.

Code: Select all

Performing Makefile project actions
vs-psp-g++ -I. -IC:/cygwin/usr/local/pspdev/psp/sdk//include -O2 -G0 -Wall -I. -IC:/cygwin/usr/local/pspdev/psp/sdk//include -O2 -G0 -Wall -fno-exceptions -fno-rtti   -c -o main.o main.cpp
make: vs-psp-g++: Command not found
make: *** [main.o] Error 127
Make : error PRJ0002 : error result returned from 'c:\docume~1\lonest~1\locals~1\temp\bat000008.bat'.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Sounds like you missed steps 2 and 3 on the first post in this thread.
Overseer
Posts: 3
Joined: Tue Nov 13, 2007 11:56 pm

Post by Overseer »

No I did them all, in fact, just to make sure. I just got finished installing cygwin, newest toolchain, and then tried these steps again on a fresh machine and I still get the same error.

Now I may of completed the steps incorrectly, but I definately did them. Only one I may of messed up would be #2. It's entirely possible that I just don't know how to make a shell script. I figured it was just a text file that you put in that directory with that name and that code inside of it.

Is there something special you have to do in that respect?

peace,
CR

EDIT: Also, when I run vs-psp-gcc or vs-psp-g++ I get this:

Code: Select all

LonestarF1@Lonestar /usr/local/pspdev/bin
$ ./vs-psp-g++
sed: -e expression #1, char 46: unknown option to `s'

LonestarF1@Lonestar /usr/local/pspdev/bin
$ sed --version
GNU sed version 4.1.5
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.
I included the sed version just in case it'd help.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

The line

Code: Select all

make: vs-psp-g++: Command not found 
shows that vs-psp-g++ cannot be executed by the makefile. Maybe the PATH environment when running from VS is not the same as the PATH when you're running it manually from the shell.

The error

Code: Select all

sed: -e expression #1, char 46: unknown option to `s' 
indicates that the contents of your vs-psp-g++ script are incorrect.
victorprosa
Posts: 37
Joined: Wed Jan 14, 2009 5:53 am

Post by victorprosa »

Sorry for bumping this thread...

But I am trying to compile pmpmod myself...

I had to patch a lot of suff on it's shared libs, but i managed to get them working (maybe i send them to ps2dev svn later), the problem is that i am not able to compile the main program:

Code: Select all

make[1]: vs-psp-gcc: Command not found
Seems that the original coder used to use VS.NET for his homebrews, cool...
but I use linux with ps2dev's PSPSDK, and there's no tutorial for adding this command to my system, this topic just gives a solution for windows users...
How could I solve this problem in linux systems?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Either use the vs-psp-gcc script provided in this thread or just use psp-gcc instead... this isn't hard :)
jcyuan
Posts: 4
Joined: Thu Jan 21, 2010 5:41 pm

Post by jcyuan »

just nice work.
it works fine. thanks!
oops
Post Reply