Recently I write a reading data interface, and face a problem, which the compiler always say my program has multiple definition of some data variable. Then I try to remove the cpp files from project file list, and put the multiple-definition variables into the header files, at last only include the respect header files, amazing thing happenen! The error disappear! Now I still not find the reason, if anyone know this reason, please tell me, I will very appreciate it! Besides, I need to mention another solution to this error, which you can place the multiple-definition variable in main.cpp only, that's also can solve this problem.
C++ multiple definition problem
最新推荐文章于 2024-07-06 06:48:56 发布