You can't compile an application that has two functions with the same name and arguments. The linker wouldn't be able to tell which is which. You put the function in only one cpp file and use and h file to let your other cpp files know what the function is.