obj/l_Key_Layered.o:l_Key_Layered.cpp:(.text+0xa): undefined reference to `l_Key_Layered::refLayerManager'
obj/l_Key_Layered.o:l_Key_Layered.cpp:(.text+0x11): undefined reference to `l_LayerManager::getActiveLayer()'
note the differences between those lines, although they are both supposed to compile a source.
The second one is not stopping at compilation, but trying to link too, because you've got a typo in your makefile
change line 2 to OBJ = obj/l_Key_Layered.o obj/l_LayerManager.o
`cc' is the C compiler. In my case is simply a link to gcc.
First of all, I read it incorrectly.
cc obj/l_Key_Layered.o -o obj/l_Key_Layered
this is a linker command, it's got the object l_Key_Layered.o and would try to build an executable with it.
This is an implicit rule, here's the process that you can see with make -d (fat removed)
Considering target file 'obj/l_Key_Layered'.
File 'obj/l_Key_Layered' does not exist.
Looking for an implicit rule for 'obj/l_Key_Layered'.
Trying pattern rule with stem 'l_Key_Layered'.
Trying implicit prerequisite 'obj/l_Key_Layered.o'.
Found an implicit rule for 'obj/l_Key_Layered'.
Considering target file 'obj/l_Key_Layered.o'.
Considering target file 'l_Key_Layered.cpp'.
No need to remake target 'l_Key_Layered.cpp'.
Considering target file 'l_Key_Layered.h'.
No need to remake target 'l_Key_Layered.h'.
Finished prerequisites of target file 'obj/l_Key_Layered.o'.
Must remake target 'obj/l_Key_Layered.o'.
g++ -Wall -std=c++11 -c l_Key_Layered.cpp -o obj/l_Key_Layered.o
Successfully remade target file 'obj/l_Key_Layered.o'.
Finished prerequisites of target file 'obj/l_Key_Layered'.
Must remake target 'obj/l_Key_Layered'.
cc obj/l_Key_Layered.o -o obj/l_Key_Layered
About the linker error http://www.cplusplus.com/forum/general/113904/
Looking at the command that caused the complain, you can see that there is no mention of main.o or of l_Layer_Manager.o
By the way obj/main.o: main.cpp $(OBJ)
$(OBJ) should not be a dependency there, or you would have to recompile main.cpp if you changed another source.