I am running OS X 10.10.5. When I try to run (from the terminal) an OpenGL code that loads some textures, I get this error: "Cannot open file chair.bmp"
The error gets issued after executing this line
chairTexture = LoadTexBMP("chair.bmp");
# Example 9
# Main target
ifeq "$(OS)" "Windows_NT"
LIBS=-lglut32cu -lglu32 -lopengl32
CLEAN=del *.exe *.o *.a
ifeq "$(shell uname)" "Darwin"
CFLG=-O3 -Wall -Wno-deprecated-declarations
LIBS=-framework GLUT -framework OpenGL
LIBS=-lglut -lGLU -lGL -lm
CLEAN=rm -f $(EXE) *.o *.a
# Compile rules
gcc -c $(CFLG) $<
g++ -c $(CFLG) $<
gcc -O3 -o $@ $^ $(LIBS)
I finally figured what I was doing wrong. I was using
open ex9 in the terminal which behaves as if I was clicking on the executable which in turns changes the working directory into the home directory. So, in order not to change the working directory I should use