News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Where to place the input file, say, an .obj file that the program reads

Started by sauparna, March 28, 2010, 12:49:19 PM

Previous topic - Next topic

sauparna

OS : Ubuntu 9.04
C::B : 8.02
FreeGLUT : 3

My program reads a 3D model from a .obj file and renders it. Somewhere in the program I call a function this way:

GLMmodel* objmodel;
objmodel = glmReadOBJ("cube.obj");


It's prototype is:

GLMmodel* glmReadOBJ(char* filename)

But my program fails to find the file when I run it from within C::B, in spite of me having placed cube.obj in all the possible directories. But if I navigate to the bin/Debug directory, where the binary is, put cube.obj there, and run it from the command line, it works.

So, where should any input file be placed in a C::B project directory, to make it available to the reading program? I had another piece of code which reads a .bmp file, that too fails in the same way.

Jenna

Did you try to put it into the projects source directory or to change the projects execution directory for the appropriate target(s) ?

sauparna

Thanks for the pointer. Setting the Build targets -> Execution working dir parameter to the project directory, i.e. ./ solves it. It was /usr/bin by default. The GLUT project base was set to /usr, and hence C::B's subsequent inference.