Finally got this thing to compile, but it's not linking any external libraries - how would I do that?
Edit:I took the rule file provided on the wiki and modified it a bit to give another supplemental rule file.
Copy the following XML file and paste it into a file called arm-linux-link.rules in c:\devkitpro\devkitGP2X:
Code:
<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
Name="GCC Linker"
Version="8.00"
>
<Rules>
<CustomBuildRule
Name="arm-linux-g++-link"
DisplayName="GCC Linker"
CommandLine="arm-linux-g++.exe $(IntDir)\*.o -o $(TargetPath) [AllOptions] [AdditionalOptions] -lpthread -static 2>&1 | sed -e s/(.[a-zA-Z]\+):([0-9]\+):/\1(\2):/"
Outputs="$(TargetPath)"
FileExtensions="*.txt"
ExecutionDescription="$(InputFileName)"
>
<Properties>
<StringProperty
Name="LibPaths"
DisplayName="Additional Library Paths"
Description="Specifies one or more directories to add to the lib path; use semi-colon delimited list if more than one."
Switch="-L[value]"
Delimited="true"
Inheritable="true"
/>
<StringProperty
Name="Libraries"
DisplayName="Additional Dependencies"
Description="Specifies one or more libraries to link to; use semi-colon delimited list if more than one."
Switch="-l[value]"
Delimited="true"
Inheritable="true"
/>
</Properties>
</CustomBuildRule>
</Rules>
</VisualStudioToolFile>
1) Add this custom build rule to your project in the same way you added the compiler rule.
2) Open the Tool Build Order dialog (Project->Tool Build Order)
3) Move the entry
GCC Linker to the very end, after
Post-build Event Tool
4) Select
Ok
5) Open the project settings (Project->Properties).
6) Open the
GCC Linker category and select the General property page.
7) Fill in any additional library paths and libraries needed to build your project
8) Remove the
Post-build Event as described in the wiki (otherwise you'd be trying to link twice).
9) Select Ok on the project settings dialog.
10) Add any file with the extension
.txt to the project, and build as normal
This is just a hacked together way of getting things to build, and allows you to link the SDL libraries etc. The text file isn't actually used by the linker, but is just a trigger to make sure the linker is called. If anybody can tidy up how I've done this, or give an alternative better way, feel free to do so
