Repeated Multiple Definition Errors from including same header in multiple cpps

后端 未结 9 1683
南方客
南方客 2020-11-27 06:12

So, no matter what I seem to do, I cannot seem to avoid having Dev C++ spew out numerous Multiple Definition errors as a result of me including the same header file in multi

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-27 06:49

    GCC 3.4 and up supports #pragma once. Just put #pragma once at the top of your code instead of using include guards. This may or may not be more successful, but it's worth a shot. And no, this is not (always) precisely equivalent to an include guard.

提交回复
热议问题