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

Recommended Answers

All 2 Replies

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.