PacktPublishing / Template-Metaprogramming-with-CPP

Template Metaprogramming with C++, published by Packt
MIT License
90 stars 27 forks source link

Chapter 6 - Compiler error GCC #7

Open ludvikjerabek opened 1 year ago

ludvikjerabek commented 1 year ago

This is being flagged as redefinition.

image

Consolidate compiler generated dependencies of target chapter_06
gmake[3]: warning:  Clock skew detected.  Your build may be incomplete.
gmake[3]: Warning: File 'src/chapter_06/CMakeFiles/chapter_06.dir/compiler_depend.make' has modification time 324 s in the future
[ 50%] Building CXX object src/chapter_06/CMakeFiles/chapter_06.dir/main.cpp.o
/mnt/c/Users/ljerabek/Documents/GitHub/Template-Metaprogramming-with-CPP/src/chapter_06/main.cpp:380:9: error: redefinition of ‘template<class T>  requires (A<T>) || (B<T>) void n621::f()’
  380 |    void f() {}
      |         ^
/mnt/c/Users/ljerabek/Documents/GitHub/Template-Metaprogramming-with-CPP/src/chapter_06/main.cpp:376:9: note: ‘template<class T>  requires (A<T>) || (B<T>) void n621::f()’ previously declared here
  376 |    void f() {}
      |         ^
/mnt/c/Users/ljerabek/Documents/GitHub/Template-Metaprogramming-with-CPP/src/chapter_06/main.cpp: In function ‘int main()’:
/mnt/c/Users/ljerabek/Documents/GitHub/Template-Metaprogramming-with-CPP/src/chapter_06/main.cpp:863:20: warning: unused variable ‘a’ [-Wunused-variable]
  863 |       wrapper<int> a{ 42 };
      |                    ^
/mnt/c/Users/ljerabek/Documents/GitHub/Template-Metaprogramming-with-CPP/src/chapter_06/main.cpp:897:20: warning: unused variable ‘a’ [-Wunused-variable]
  897 |       wrapper<int> a{ 42 };
      |                    ^
gmake[3]: *** [src/chapter_06/CMakeFiles/chapter_06.dir/build.make:76: src/chapter_06/CMakeFiles/chapter_06.dir/main.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:372: src/chapter_06/CMakeFiles/chapter_06.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:379: src/chapter_06/CMakeFiles/chapter_06.dir/rule] Error 2
gmake: *** [Makefile:189: chapter_06] Error 2