Here is my folder structure:
/
|
-- program.cpp
-- utility.h
-- utility.cpp
|
-- module/
|
-- utility.h
-- utility.cpp
// Note that I have two files named utility.h and two named utility.cpp
On building the project, I get a link error (LNK2028: unresolved token and so on...) saying that some symbols aren't defined. I have confirmed that all symbols are defined and that all declared functions have a corresponding definition.
I have a feeling that on compiling my project, the utility.cpp
files from both folders are compiled into the same utility.obj
in the output folder. As a result, one overwrites the other.
- Is this expected behaviour?
- How do I build a C++ binary which has two files with the same name (though in different folders)?