vs2008c++ 为啥不认pragma

xiaotuzi 2011-09-21 07:32:52
错误 1 fatal error C1021: 无效的预处理器命令“Pragma” d:\快盘\livetestcode\programsharp\programsharp\programsharp\programsharp.cpp 7 programSharp



// programSharp.cpp : 定义控制台应用程序的入口点。
//


#include "stdafx.h"
#define _X86 xuhaitian
#ifdef _X86
#Pragma message("_X86 macro activated!")
#endif

int _tmain(int argc, _TCHAR* argv[])
{
int a,b;
a=4;b=3;

a ^= b;
b ^= a;
a ^= b;

return 0;
}

...全文
120 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaotuzi 2011-09-25
  • 打赏
  • 举报
回复
定义了,,重新build了,可是没有的。谢谢各位,结贴送分
真相重于对错 2011-09-23
  • 打赏
  • 举报
回复
定义_X86了没?
退学者的游戏 2011-09-22
  • 打赏
  • 举报
回复
#pragma 小写p
fox000002 2011-09-22
  • 打赏
  • 举报
回复
#pragma 这种预处理指令,也就是在 build 的时候显示

运行时没有作用
xiaotuzi 2011-09-22
  • 打赏
  • 举报
回复
再问问,为啥vc6的编译输出窗口里面有显示_X86 macro activated!
而vs2008 c++的编译输出窗口里面没有呢

“programSharp.exe”: 已加载“D:\快盘\liveTestCode\programSharp\programSharp\Debug\programSharp.exe”,已加载符号。
“programSharp.exe”: 已加载“C:\Windows\System32\ntdll.dll”
“programSharp.exe”: 已加载“C:\Windows\System32\kernel32.dll”
“programSharp.exe”: 已加载“C:\Windows\System32\KernelBase.dll”
“programSharp.exe”: 已加载“C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll”,已加载符号。
xiaotuzi 2011-09-22
  • 打赏
  • 举报
回复
谢谢,偶蛮笨的
真相重于对错 2011-09-21
  • 打赏
  • 举报
回复
大小写?

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧