i am having trouble with getting source files to compile when they include headers in different folders.
eg.
src/folderA/constants.h:
src/folderB/program.cCode:#define constant1 51
src/makefile:Code:#include "constants.h" #include <iostream> int main () { cout << constant1; return 0; }
This won't compile since program.c doesn't know where constants.h is,Code:program: program.o $(CC) program.o -o program program.o: src/folderB/program.c $(CC) -c src/folderB/program.c -o program.o




Reply With Quote