If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: spreading source across folders

Originally Posted by rowdy

src/folderA/constants.h:

Code:

#define constant1 51

src/folderB/program.c

Code:

#include "constants.h"
//...

This won't work, because you're telling the compiler to look for the constants.h file in the same location as the program.c file. Either use a relative path to the header file or use #include <> and set 'folderA' as an include directory.

Cheers, D Drmmr

Please put [code][/code] tags around your code to preserve indentation and make it more readable.

As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

using "" or <> for include files works more or less equivalent, except that the order in that direcories are searched for the files differs. I have read the recommendation to use "" for own files and <> for system files.