无法在stdafx.h中定义 [英] Cannot define in stdafx.h

查看:144
本文介绍了无法在stdafx.h中定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS 2010 sp1中的stdafx.h文件中执行此操作时:

When doing this in VS 2010 sp1 in stdafx.h file:

#include <memory>

#define ptr_type std::shared_ptr  

fatal error C1004: unexpected end-of-file found


推荐答案

在您的.cpp文件中,您需要将 #includestdafx.h 作为第一行代码。这是为了预编译头支持。

In your .cpp file, you need to put #include "stdafx.h" as your first line of code. This is for precompiled header support.

编辑:我错了;我想的错误是 C1010:寻找预编译头文件时意外结束

I'm wrong; the error I'm thinking of is "C1010: unexpected end of file while looking for precompiled header".

这篇关于无法在stdafx.h中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆