subdirs and object files - anyone please help

Can someone tell me how to use the file properly

This is the problem 

I have a directory called src with the main file called main.c.  every file
includes main.h 

I also have a subdirectory called menu (src/menu)
in there is menu.c, menu.h, filemenu.c, filemenu.h ..........
main.c includes menu.h ..... so in the end when it comes time to compile
link main.o with src/menu.o it doesn't work because gcc is looking for
menu.o not src/menu.o

So the problem is as soon as main.c depend's on [any f*cking
subdirectroy]/filename.o shit hits the fan

could someone tell me how for over 30 years software engineers have been
able to, by keeping in the file heirachy, get around my problem

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]