I'm pretty new to direct x and c++, I have a problem with loading .obj files.

This is a cube

I think the problem is with creating vertices and indecies.

list<vertex> FinalVertices;

list<unsigned long> Indecies;
for (int i = 0; i < Faces.size(); i++)
{
for (int j = 0; j < Faces.size(); j++)
{
if (Faces[i] == Faces[j])
{
cout << 'b' << endl;
if (i == j)
{
FinalVertices.push_back(Faces[i]);
Indecies.push_back(j);
}
goto a;
}
}
a:
cout << ' ';
}


It looks like you're adding an index only when you encounter a new unique vertex. You want to add the index for repeated vertices too, so move that line outside the if (i==j) block.
if (Faces[i] == Faces[j]) {