error C2011: '' : 'class' type redefinition

前端 未结 3 1498
情歌与酒
情歌与酒 2020-12-31 01:40

One of the header files is as follows -

#include \"stdafx.h\"

class AAA
{
public:
    std::string strX;
    std::string strY;
};

When I tr

3条回答
  •  天涯浪人
    2020-12-31 02:04

    In addition to the suggested include guards you need to move #include "stdafx.h" out of the header. Put it at the top of the cpp file.

提交回复
热议问题