0

Hello All,

I new to this forum and C++. Searched a lot on the web, but could not find
help anywhere.

I have two directories under each of which, I have multiple .cpp files.
Each of the directories have a one .h include file that contains function declrations
for all the .cpp files under that directory. Now, some files under DIR_A call functions
that are declared and defined under the DIR_B. So, when I use make file to
compile the files, i get "function not declared error" for those functions that are called in
one folder but defined in the other.
I have make file for each of the two folders.

Any help regarding this will help me a lot.

Thanks,
bhargsy

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by bhargsy
0

Do you also have a makefile in the parent directory, which runs the two sub-directory makefiles, then combines both results into a single program?

In each sub-dir makefile, you could set the compiler options to also have -I../DIR_B as an additional search path.

0

yes Salem. I have a makefile in the parent directory and i have also included
the path to DIR_B in the makefile of DIR_A. I still seem to get the error.

-bhargsy

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.