I have been trying many times to resolve this issue and also searched in Google some solutions but I ended up not finding the solution to my problem.
Every time I run my code, I get this prompt from <string>:
Unhandled exception at 0x764C1812 in
Tani's Method.exe: Microsoft C++ exception: std::invalid_argument at memory location 0x006FEE18.
The only thing I used <string> in my code is this very only line of code:
Oh, I see now the problem. I tried to change the obj file to another one (e.g. sphere.obj). It worked fine now. Maybe there's something fishy with the pyramid file? I am not sure though. Thank you Duthomhas! :)