MadDog
Member
This is a short doc on some stuff i've done to get GCC compiling for me in dotnet. Its not perfect, theres prob a better way of doing it. I looked at doing a plugin but the API is hell!
So, here goes.
First you need to add the path to gcc.exe and the tools it calls to the VC++ directories.
tools->options->Projects->VC++ Directorys.
Mine are...
C:\devkitGP2X\arm-linux\bin
C:\devkitGP2X\bin
C:\devkitGP2X\minsys\bin
C:\devkitGP2X\libexec\gcc\arm-linux\4.0.2
Ok, thats the global one time setup stuff done. Now lets set up the project.
Make a win32 project, but setting it to be empty.
Now that is done, you need to setup the source files. I've done a bit of work to find a way where the custom command can be cut'n'paste when you add files.
Get the properties page open for the sourcefile and set the tool to "Custom Build Tool". Press the apply button. This will now have changed the dialog and you should now only have the Custom Build Step option.
Go to this page and in the command line type the following $(ProjectDir)build_file.bat $(InputPath) $(OutDir)\$(InputName).o
In the Outputs add "$(OutDir)\$(InputName).o" This is needed so that the compile otion is active for the source file.
You may want to clear the discription field, don't want that on every source file.
Now you need to make a batch file for calling GCC, its in here that your add you include dirs for the project and global defines.
I've done it like this as dev as far as I can see has no enviroment var for these project settings. No big deal though.
In the batch file your need at least "arm-linux-gcc %1 -c -o %2", you may want to add "echo %1" as the first line.
The %1 is the first param to the batch file, remember that on the file dev is calling $(ProjectDir)build_file.bat $(InputPath) $(OutDir)\$(InputName).o
So the %1 is changed to the name of the source file. %2 is where the object file goes. Done so that dev can see if the file is upto date, if it is then the file is not compiled.
None of the enviroment varibles for system includes were setup on my system, so i've had to set them up. I've used CPATH,
not sure if thats the correct one. Could have added them with the -I option in my batch file but if I got a new compiler version i'll be a bit stuck having to fix all the bat files for my projects.
Mine is set to....
C:\devkitGP2X\include;C:\devkitGP2X\include\c++\4.0.2\arm-linux;C:\devkitGP2X\include\c++\4.0.2;C:\devkitGP2X\include;C:\devkitGP2X\include\sdl;C:\devkitGP2X\sysroot\usr\include;C:\devkitGP2X\lib\gcc\arm-linux\4.0.2\include
Little note, dotnet will not know about any changes without it being shutdown then restarted.
Now this is done we need to link all the object files, this is done with one setting for the whole project.
Go to the Project "Property pages" dialog and the builds event page. On the Post-Build Event command line add
arm-linux-gcc $(OutDir)\*.o -o $(ProjectName).gpe -BC:\devkitGP2X\lib -static -lstdc++ -lSDL_image -ljpeg -l png12 -lz -lpthread -lSDL_mixer -lvorbisidec -lmikmod -lSDL -lSDL_ttf -lfreetype -lm -lsmpeg -ldl -lSDL -lpthread
May want to change the deiscription box to Linking. Just so you know what its doing.
And that 'should' work.
So, here goes.
First you need to add the path to gcc.exe and the tools it calls to the VC++ directories.
tools->options->Projects->VC++ Directorys.
Mine are...
C:\devkitGP2X\arm-linux\bin
C:\devkitGP2X\bin
C:\devkitGP2X\minsys\bin
C:\devkitGP2X\libexec\gcc\arm-linux\4.0.2
Ok, thats the global one time setup stuff done. Now lets set up the project.
Make a win32 project, but setting it to be empty.
Now that is done, you need to setup the source files. I've done a bit of work to find a way where the custom command can be cut'n'paste when you add files.
Get the properties page open for the sourcefile and set the tool to "Custom Build Tool". Press the apply button. This will now have changed the dialog and you should now only have the Custom Build Step option.
Go to this page and in the command line type the following $(ProjectDir)build_file.bat $(InputPath) $(OutDir)\$(InputName).o
In the Outputs add "$(OutDir)\$(InputName).o" This is needed so that the compile otion is active for the source file.
You may want to clear the discription field, don't want that on every source file.
Now you need to make a batch file for calling GCC, its in here that your add you include dirs for the project and global defines.
I've done it like this as dev as far as I can see has no enviroment var for these project settings. No big deal though.
In the batch file your need at least "arm-linux-gcc %1 -c -o %2", you may want to add "echo %1" as the first line.
The %1 is the first param to the batch file, remember that on the file dev is calling $(ProjectDir)build_file.bat $(InputPath) $(OutDir)\$(InputName).o
So the %1 is changed to the name of the source file. %2 is where the object file goes. Done so that dev can see if the file is upto date, if it is then the file is not compiled.
None of the enviroment varibles for system includes were setup on my system, so i've had to set them up. I've used CPATH,
not sure if thats the correct one. Could have added them with the -I option in my batch file but if I got a new compiler version i'll be a bit stuck having to fix all the bat files for my projects.
Mine is set to....
C:\devkitGP2X\include;C:\devkitGP2X\include\c++\4.0.2\arm-linux;C:\devkitGP2X\include\c++\4.0.2;C:\devkitGP2X\include;C:\devkitGP2X\include\sdl;C:\devkitGP2X\sysroot\usr\include;C:\devkitGP2X\lib\gcc\arm-linux\4.0.2\include
Little note, dotnet will not know about any changes without it being shutdown then restarted.
Now this is done we need to link all the object files, this is done with one setting for the whole project.
Go to the Project "Property pages" dialog and the builds event page. On the Post-Build Event command line add
arm-linux-gcc $(OutDir)\*.o -o $(ProjectName).gpe -BC:\devkitGP2X\lib -static -lstdc++ -lSDL_image -ljpeg -l png12 -lz -lpthread -lSDL_mixer -lvorbisidec -lmikmod -lSDL -lSDL_ttf -lfreetype -lm -lsmpeg -ldl -lSDL -lpthread
May want to change the deiscription box to Linking. Just so you know what its doing.
And that 'should' work.