Here is a simple program I made up real quick. This is as far as I have got.

Code:

#include <iostream>
#include <vector>
using namespace std;
struct mytype
{
int one;
int two;
int three;
};
void SortMyVec(vector<mytype>::iterator iter1, vector<mytype>::iterator iter2);
int main()
{
mytype numbers;
vector<mytype> myvec;
vector<mytype>::iterator iter1;
vector<mytype>::iterator iter2;
numbers.one=5; numbers.two=6; numbers.three=7;
myvec.push_back(numbers);
numbers.one=9; numbers.two=0; numbers.three=1;
myvec.push_back(numbers);
numbers.one=1; numbers.two=2; numbers.three=3;
myvec.push_back(numbers);
numbers.one=5; numbers.two=3; numbers.three=4;
myvec.push_back(numbers);
numbers.one=8; numbers.two=9; numbers.three=0;
myvec.push_back(numbers);
for (int a=0; a<myvec.size(); a++)
{
numbers=myvec.at(a);
cout<<numbers.one<<" "<<numbers.two<<" "<<numbers.three<<endl;
}
cout<<endl;
iter1=myvec.begin();
iter2=myvec.end();
SortMyVec(iter1, iter2);
for (int a=0; a<myvec.size(); a++)
{
numbers=myvec.at(a);
cout<<numbers.one<<" "<<numbers.two<<" "<<numbers.three<<endl;
}
cout<<endl;
cin.get();
return 0;
}
void SortMyVec(vector<int>::iterator iter1, vector<int>::iterator iter2)
{
sort(iter1, iter2);
return;
}

What I want to do is sort the vector by the first integer and then by the second integer so my output is like this

Code:

1 2 3
5 3 4
5 6 7
8 9 0
9 0 1

It works fine if I use just a single integer for each element of the vector instead of the struct. But when I use the struct I get

Code:

[Linker error] undefined reference to `SortMyVec(__gnu_cxx::__normal_iterator<mytype*, std::vector<mytype, std::allocator<mytype> > >, __gnu_cxx::__normal_iterator<mytype*, std::vector<mytype, std::allocator<mytype> > >)'

I am not sure where to go from here. Anyone got ay ideas?