how solve it clion not link any function in other file

c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: CMakeFiles\Project1.dir/objects.a(file1.cpp.obj): in function `Z3mulii':
C:/Users/musta/CLionProjects/Project1/file1.cpp:2: multiple definition of `mul(int, int)'; CMakeFiles\Project1.dir/objects.a(main.cpp.obj):C:/Users/musta/CLionProjects/Project1/file1.cpp:2: first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [Project1.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/Project1.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles/Project1.dir/rule] Error 2
mingw32-make.exe: *** [Project1] Error 2
CMakeFiles\Project1.dir\build.make:119: recipe for target 'Project1.exe' failed
CMakeFiles\Makefile2:94: recipe for target 'CMakeFiles/Project1.dir/all' failed

1 comment
Comment actions Permalink


It seems you have multiple definitions of mul(int, int) in your project. Why is that?


Please sign in to leave a comment.