Skip to content

Latest commit

 

History

History

multiple-definitions-of-stand-alone-function-in-source-files

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Функция:

void foo() {
  return;
}

определена в файлах a.cpp и b.cpp, что приводит к ошибке:

/tmp/ccvV3l7z.o: In function `foo()':
b.cpp:(.text+0x0): multiple definition of `foo()'
/tmp/ccph9CpZ.o:a.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status