English 中文(简体)
如何检查管理事务编辑是否将汇编我的源代码
原标题:How to check if MS compiler will compile my source code
  • 时间:2011-11-16 13:24:44
  •  标签:
  • c++

我正试图在万国邮局做这样的事情:

#ifdef _MSC_VER
#include "stdafx.h"
#endif  

但我错了,告诉我:

C1020: unexpected #endif

这样做的正确方式是什么?

Edit
/This is content of stdafx.h/

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

//#include <stdio.h>
//#include <tchar.h>
#include <iostream>
using std::cout;
using std::cerr;

// TODO: reference additional headers your program requires here
最佳回答

由于MSVC预谋领导者的工作方式,你不能将条件放在 st上。 它基本上取代一旦发现打耳机(通常需要#include “stdafx.h”作为档案第一行)时的装饰物,因此,就如同你从未写过#if_MSC_,并且有额外的#endif

两种解决办法:

(1) 在你的项目中不使用有预谋的负责人。 你们仍然能够使用笔记,把你要求的所有负责人都包括在内,但汇编工作进展缓慢。

2) 将有条件的汇编整理在笔迹中。

(Taken from here)

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?