What happens when cPP compiles with unused files linked?

//test.cpp
int main(){
    return 0;
}

suppose a simple .cpp file is compiled into executable test, via gPP test.cpp-o test if other extraneous .cpp or library files are linked at compile time, such as
gPP test.cpp-lpthread-o test ,
gPP test.cpp base.o-o test ,
gPP test.cpp base.cpp-o test ,
if there is no conflict in the compilation process. Is there any difference between the compilation process and the result?

CPP
Mar.14,2021

if there is a conflict, an error will be reported. For example, if you link two objects with main functions or conflicting libraries (the library name corresponds to the function name, but the parameters do not correspond to each other), linking an unrelated library will only increase the size of the executable file

.
Menu