GP2X How To Use Visual C++ 2005 Express


mattyrb posted on Dec 3 2005 at 04:50 AM said:
Right I've successfully set the damn thing up!

I'd just like to say you lot have been a great help so far! This community sure does have alot of friendly, patient, helpful people in it!

Any ideas for how i can test my applications other than owning a GP2X....I'd like one but not right now hehe When I've got the cash maybe!
Good stuff!

As for testing without having a GP2X... not possible. If there was a GP2X emulator for Windows, yes, but there is no emulator yet.
 
Last edited by a moderator:
slygamer posted on Dec 12 2005 at 10:56 PM said:
Have you added SDL and SDL_image to the Additional Dependencies in the GCC Linker settings? It needs to know which libraries to link, not just where they might be.

Yes, I've tried that. Not sure whats up with it - It must be something simple I'm overlooking. I'll try again tomorrow with a fresh set of eyes. I can compile the same project fine from the command line. Cheers.
 
Last edited by a moderator:
Galleon posted on Dec 13 2005 at 08:25 AM said:
Yes, I've tried that. Not sure whats up with it - It must be something simple I'm overlooking. I'll try again tomorrow with a fresh set of eyes. I can compile the same project fine from the command line. Cheers.
Check in BuildLog.htm to see what command-line it is executing for the linker.
 
Last edited by a moderator:
I have a strange problem which is stopping the linker from working (compiler is working fine, get the .o files). Output is:

1>------ Build started: Project: gp2xtest, Configuration: Debug Win32 ------
1>main.cpp
1>Linking gp2xtest.gpe...
1>arm-linux-gcc.exe: 2: No such file or directory
1>'gt' is not recognized as an internal or external command,
1>operable program or batch file.
1>'amp' is not recognized as an internal or external command,
1>operable program or batch file.
1>Project : error PRJ0002 : Error result 255 returned from 'C:\WINDOWS\system32\cmd.exe'.
1>Build log was saved at "file://c:\gp2xtest\Debug\BuildLog.htm"
1>gp2xtest - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

arm-linux-gcc.exe is accessible from the command line, so the PATH is set correctly. Any ideas? I had to change line 97 on the .rules file, replacing "$(TargetPath)" with $(TargetPath) to make the rules file import. There are no spaces in the path (I've put the folder in the root of the drive).

For reference I attempted to build test2.zip from slygamer, the build log is here: http://www.boogleoogle.co.uk/BuildLog.htm

Any ideas? Thanks :)

Edit: Oh, my build log is here: http://www.boogleoogle.co.uk/BuildLog2.htm
 
It's all to do with damned HTML and XML markup.

The command line for the linker rule will have the incorrect escaping for the "2>&1" section of the command line. Check that this matches the corresponding section in the compiler rule command line. You can do this through the dialog interface in VS2005 (right-click on the project, select Custom Build Rules) or close the IDE and edit the .rules file directly.

Edit: I also see that someone has edited the wiki page and added double quotes around the $(TargetPath) section in the linker command line. This will most likely not work as intended because the entire line is surrounded by double quotes, hence the need to escape them. I will fix this when I get home tonight.
 
slygamer posted on Dec 20 2005 at 11:12 PM said:
It's all to do with damned HTML and XML markup.

The command line for the linker rule will have the incorrect escaping for the "2>&1" section of the command line. Check that this matches the corresponding section in the compiler rule command line. You can do this through the dialog interface in VS2005 (right-click on the project, select Custom Build Rules) or close the IDE and edit the .rules file directly.

Edit: I also see that someone has edited the wiki page and added double quotes around the $(TargetPath) section in the linker command line. This will most likely not work as intended because the entire line is surrounded by double quotes, hence the need to escape them. I will fix this when I get home tonight.

Of course! At work now though, so I'll have a play when I get back home. Can't believe I didn't pick that up. Thanks :D
 
Last edited by a moderator:
slygamer posted on Dec 21 2005 at 11:52 AM said:
Fixed the quoting from the previous edit in the wiki page. Added quoting where it may be required elsewhere (include paths, library paths, etc).

Works great (the quotes are making a massive difference) - although the linker still isn't working:

1>Linking gp2xtest.gpe...
1>arm-linux-gcc.exe: Debug\*.o: Invalid argument
1>arm-linux-gcc.exe: no input files

The path isn't absolute, which I think is throwing off the linker. The command issued by VS is:

arm-linux-gcc.exe "Debug\*.o" -o "c:\gp2xtest\Debug\gp2xtest.gpe" -static 2>&1 | sed -e s/(.[a-zA-Z]\+):([0-9]\+):/\1(\2):/

Don't have a clue which variable holds the full path to the debug directory though :unsure:

Update:

I updated $(IntDir) to $(ProjectDir)$(IntDir), which gave the full path. However the error is the same. Looks like I will be continuing my search :)
 
Last edited by a moderator:
All the commands are run relative to the project directory. Do you have a 'Debug' directory alongside your vcproj file? Take at the gcc command-lines to see where gcc putting the .o files it is creating in the compile step.
 
slygamer posted on Dec 21 2005 at 10:40 PM said:
All the commands are run relative to the project directory. Do you have a 'Debug' directory alongside your vcproj file? Take at the gcc command-lines to see where gcc putting the .o files it is creating in the compile step.

Compiler is working fine - the .o files are all in the Debug directory, which is in the project directory.

So:

C:\gp2xtest\

Project / Source files

C:\gp2xtest\Debug\

.o files, BuildLog.htm

Which is why I don't understand why the linker isn't working. I'm confused :blink:
 
Last edited by a moderator:
Hi,
I use the arm-linux.rules on the wiki but I have one problem to link.

Here is the command used to link :
F:\...\Visual Studio 2005\Projects\testgp2x\
testgp2x>arm-linux-gcc.exe Debug\Main.o -o "f:\...\visual studio 2005\projects\testgp2x\debug\testgp2x.gpe" -L"F:\Compil\de
vkitGP2X\lib" -llibSDLmain.a -llibSDL.a -static 2>&1 | sed -e s/(.[a-zA-Z]\+)
:([0-9]\+):/\1(\2):/

I have the folowing error :
f:\compil\devkitgp2x\bin\..\lib\gcc\arm-linux\4.0.2\..\..\..\..\arm-linux\bin\ld
.exe: cannot open output file f:\...\visual
studio 2005\projects\testgp2x\debug\testgp2x.gpe: No such file or directory

Can you help me :blink:
 
Last edited by a moderator:
"f:\...\visual studio 2005\projects\testgp2x\debug\testgp2x.gpe"

That looks like your problem imo, you can't go a directory higher than the root so its getting confused. I assume your project file is in: "f:\visual studio 2005\projects\testgp2x?

Have you tried putting the testgp2x folder in the root of the drive just to test?
 
I have just tried but it changed nothing (I have the same error) :

Here is the BuildLog.htm :
Creating temporary file "f:\testgp2x\testgp2x\Debug\BAT00000133401096.bat" with contents
[
@echo off

arm-linux-gcc.exe Debug\*.o -o "f:\testgp2x\debug\testgp2x.gpe" -lpthread -static 2>&1 | sed -e s/(.[a-zA-Z]\+):([0-9]\+):/\1(\2):/

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from "Linking testgp2x.gpe..."

exit 1

:VCEnd
]
Creating command line "f:\testgp2x\testgp2x\Debug\BAT00000133401096.bat"
 
Last edited by a moderator:
One of the problems with your first attempt may have been the three dots. One dot is the current directory. Two dots is the parent directory. What is three dots? The command-line cd command seems to ignore three dots completely.

What was the exact error message from your second attempt? Does f:\testgp2x\debug exist?
 
It seems to work now. I did a new project and there is no longer any problem :)

I would like to know if we must use the library pthread to link (in Additional dependencies) ?

Somebody has already tried to make a project using a library (made with a projet in the same solution containing the project used to make the .gpe) ?

Thanks :D
 
If you are using SDL or rlyeh's Minimal SDK, then yes you must link with pthread.

I have successfully compiled and linked a solution containing multiple projects (two libraries and the application).
 
Ok.

There is one problem with the additional include paths :
>arm-linux-gcc.exe -c -I"F:\Compil\devkitGP2X\include" -I"F:\Projects\Lib3dGp2x\tinyxml\" -o Debug\main.o ".\main.cpp" 2>&1 | sed -e s/(.[a-zA-Z]\+):([0-9]\+):/\1(\2):/

arm-linux-gcc.exe: no input files
 
Last edited by a moderator:
Ok, I found it !
There was a ")" at the end of my second path :(

>arm-linux-gcc.exe -c -I"F:\Compil\devkitGP2X\include" -I"F:\Projects\Lib3dGp2x\tinyxml" -o Debug\main.o ".\main.cpp" 2>&1 | sed -e s/(.[a-zA-Z]\+):([0-9]\+):/\1(\2):/
 
Last edited by a moderator:
Back
Top