transact.h(226) : error C2059: syntax error : 'constant'

f:\program files\microsoft visual studio\vc98\include\transact.h(226) : error C2059: syntax error : 'constant'
f:\program files\microsoft visual studio\vc98\include\transact.h(271) : error C2143: syntax error : missing ';' before '}'
f:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
f:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'
f:\program files\microsoft visual studio\vc98\include\oledb.h(17149) : error C2143: syntax error : missing ';' before '}'

 

 

vc6 + sdk03
头文件搜索的顺序,sdk03的include路径比较vc6的靠前


原因是

vc6的\VC98\Include\transact.h中的这里
typedef
enum XACT_E
    {    XACT_E_FIRST    = 0x8004d000,
    XACT_E_LAST    = 0x8004d01e,
    XACT_S_FIRST    = 0x4d000,
    XACT_S_LAST    = 0x4d009,
        
和sdk03的Microsoft SDK\include\WinError.h目录中的这里
#define XACT_E_FIRST   0x8004D000
#define XACT_E_LAST    0x8004D029
#define XACT_S_FIRST   0x0004D000
#define XACT_S_LAST    0x0004D010    

有冲突


解决办法:
在stdafx.h中增加如下代码即可

#include <transact.h>

转载于:https://www.cnblogs.com/vc60er/archive/2012/12/18/2823679.html

error C2059: syntax error : 'constant' 参数输入时,不小心将逗号。输入成句号了!晕死 阅读详情

相关推荐

C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\transact.h(226) : error C2059: syntax error

问题: 在工程中使用了  COleControlSite            并在cpp中包含#include 使用新SDK后出现C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\transact.h(226) : error C2059: syntax error :等错误。   我的解决方法:在出错的cpp文件中#includ

mail_cm的专栏 2500

C++ builder 12中出现的BYTE冲突解决

C++ builder 12中BYTE冲突解决

gongzhu110的专栏 301

VS2008 编绎时提示 transact.h(227) 错误

错误提示: d:\program files\microsoft visual studio\vc98\include\transact.h(226) : error C2059: syntax error : 'constant' 处理方法: 调整VC2008的include 路径里的顺序,将SDK目录放在前面.

自学C++,会写HelloWorld 183

VC中使用wxWidgets 出现的编译错误 error C2059: syntax error : 'constant' 解决

From WxWiki 在使用VC编译wxWidgets时,很多新手出现的编译错误:error C2059: syntax error : 'constant' First, look at Compiling A WxWidgets Application to see what you need for your new project settings. 首先,检查您的WxWi

天外飞猪的家 1万+

c语言错误代码c2059syntax,突然出现错误gdiplustypes.h(280): error C2059: syntax error : 'constant'等未知错误(示例代码)...

gdiplustypes.h(280): error C2059: syntax error : ‘constant‘gdiplustypes.h(280): error C2238: unexpected token(s) preceding ‘;‘gdiplustypes.h(281): error C2059: syntax error : ‘constant‘gdiplustypes.h(...

weixin_39664962的博客 1371

c语言 constant错误,求助大神指点,error C2059: syntax error : 'constant'

该楼层疑似违规已被系统折叠隐藏此楼查看此楼#ifndef _FILEMANAGER_H_#define _FILEMANAGER_H_#include /////////////////////////////////////////////////////////////////////////////// Data Definition// Function statustypedef in...

weixin_34778803的博客 944

VS中使用CXTPDockingPane出现的编译错误 error C2059: syntax error : 'constant' 解决

VS中使用CXTPDockingPane出现的编译错误 error C2059: syntax error : 'constant' 解决 : 安装了Codejock.ToolkitPro.MFC.v15.1.3.0908时一些配置设置,导致它自动添加了codejock安装目录下的版本库,然后出现这个错误在 public: static double PI; static double E

CSDNMicrosoftCSDN的专栏 3627

C2059 “常量”错误

编程时遇到报错200+,几乎清一色的是C2059 “常量” 代码这里就不贴出来了,报错和代码无关。 检查报错位置发现是原本程序里有的,我从来没改过的一些常量定义。 尝试把在主程序加的函数调用注释掉还是会报错,只是在【输出】主程序下面位置报错消失了。就说明是我新添加的两个类里的问题。 找csdn发现头文件位置可能会导致问题,尝试把自己加的头文件放在最后,还是报错。 放在最前面,成功生成。 老规矩参考文献:winbase.h(14824): error C2059: syntax e

partyanimalw的博客 742

C++ error C2059: 语法错误:“常数”

环境:Win10, x64, VS2017,NX 记录日期:2020/09/10 错误描述: NX二次开发时,新建了一个头文件 a.hpp,部分代码如下: #include <uf_defs.h> #include <uf_ui_types.h> #include <iostream> //牙形类型 enum class DllExport FORM_TYPE { UNIFIED = 0, METRIC, //出错语句

qq_30722721的博客 1万+

error C2059: 语法错误:“常量”解决方案

场景添加海康,宇视SDK对接的头文件和库文件,编译出错提示error C2059: 语法错误:“常量”。显示宇视SDK头文件NetDEVSDK.h中宏定义异常typedef enum tagNETDEV_PASSIVEDECODE_CMD{PASSIVE_DEC_PAUSE = 1, /* 被动解码暂停(仅文件流有效) */PASSIVE_DEC_R...

1万+

C2059: syntax error : 'constant'帮忙了

//*************** sequense.h **************////#pragma once#ifndef  SEQUENSE_H#define SEQUENSE_H#include #include using namespace std;template class sequense{public: sequense(T a[],int size); ~seque

gisergising 7035

C和C++混合编程

From: http://blog.ednchina.com/tianlebo/479334/message.aspx extern "C"表示编译生成的内部符号名使用C约定。C++支持函数重载,而C不支持,两者的编译规则也不一样。函数被C++编译后在符号库中的名字与C语言的不同。例如,假设某个函数的原型为:void foo( int x, int y ); 该函数被C编译器编译后在符号库中的名...

weixin_33721344的博客 338

2059 – 身份验证插件’caching_sha2_password’-navicat连接异常

(adsbygoogle = window.adsbygoogle || []).push({}); 2059 – 身份验证插件’caching_sha2_password’-navicat连接异常 当前位置: Home » material » Archit » 2059 – 身份验证插件’caching_sha2_password...

测试 998
上一篇: 不懂就问
下一篇: (转)createProcess时不显示或者不创建窗口
afdd28617
博客等级 码龄12年 0粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值