两个hpp #include 了同一个hpp导致multiple definition of 'xxxx' . #ifndef #define #end没生效?
1. main 文件 #include了 a.hpp
2. a.hpp 和 b.hpp 都 #include c.hpp
3. c.hpp和a, b.hpp有些不同,a和b里面是class. 但是c里面并没有class. 里面的内容为 namespace c{ 函数a, 函数b, 函数c }
4. 所有hpp都有 #ifndef #define #endif
5. 就是编译报错: main.cpp multiple definition of ' namespace c 的函数a,b,c'
请问这个 #ifndef #define #endif 是没有生效吗?