查找预编译的头文件时跳过头文件

Trt*_*rts 3 c++

你能帮我理解问题是什么吗?我似乎已经包括在内stdafx.h.然后我尝试重建解决方案.试图清理解决方案.无论如何我得到了这个:

c:\...\tetris\figure_factory.cpp(2): warning C4627: '#include "figure_factory.h"': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\...\tetris\tetris\figure_factory.cpp(3): warning C4627: '#include "figure.h"': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
Run Code Online (Sandbox Code Playgroud)

当然还有缺少头文件后的全套错误.

我的文件:

figure_factory.cpp


#pragma once
#include "figure_factory.h"
#include "figure.h"
#include "stdafx.h"
#define stop __asm nop

Figure I;
I.shape = {
            {{0, 0, 0, 0}, 
             {1, 1, 1, 1},
             {0, 0, 0, 0},
             {0, 0, 0, 0}},
......



figure_factory.h

#pragma once
#include "figure.h"
#include "stdafx.h"
#define stop __asm nop


class Figure_Factory{
    const int figure_number = 5; 
    const int colour_number = 5; 

    public:
        Figure get_figure(int type, int colour);
}
Run Code Online (Sandbox Code Playgroud)

Log*_*orn 7

stdafx.h如果您使用预编译头和Microsoft编译器,必须首先包含文件.并且您不得将其包含在其他包含文件中.并且#pragma once.cpp文件中没用