Hi,
I'm making an OpenGL application in C++ on Mac OS X 10.4.2 using a MakeFile.
I made an "Object" class that will be able to read a .OBJ file to construct a shape. The problem is that whatever function I use to open the file, the file doesn't get opened :
The code get compiled without any errors but when I run the Application it outputs both "File not opened" and "Doesn't work".
The .OBJ file is in the same directory than the C++ file. I tryed to put it in all the other directories of my project, to write the file path differently ... nothing works. I test the same code in XCode and it works. I'm really disappointed.
I looked for a solution on all the net and didn't find any working one ... maybe you can help me ?
Thank you in advance.
I'm making an OpenGL application in C++ on Mac OS X 10.4.2 using a MakeFile.
I made an "Object" class that will be able to read a .OBJ file to construct a shape. The problem is that whatever function I use to open the file, the file doesn't get opened :
Code:
#include <iostream>
#include <fstream>
using namespace std;
... some code
FILE * pFile = fopen ("cube_s10.obj", "rt");
if (pFile==NULL) printf ("File not opened\n");
ifstream file ("cube_s10.obj");
if (file.is_open()){
printf ("Works !\n");
}else{
printf ("Doesn't work\n");
}
The code get compiled without any errors but when I run the Application it outputs both "File not opened" and "Doesn't work".
The .OBJ file is in the same directory than the C++ file. I tryed to put it in all the other directories of my project, to write the file path differently ... nothing works. I test the same code in XCode and it works. I'm really disappointed.
I looked for a solution on all the net and didn't find any working one ... maybe you can help me ?
Thank you in advance.