智能终端定制开发 ad
MTK/瑞芯微/高通-Android,智能模块/智能终端方案商

深度定制各类智能终端和智能硬件产品,提供硬件选型咨询、参考设计、元器件推荐、驱动开发、行业模块集成、操作系统定制与算法集成等软硬件定制服务。
contact.aspx

Android核心板产品覆盖2G、3G、4G通讯,双核、四核、八核CPU,可选的平台有MTK6580、MTK6737、MTK6750等,Android版本有5.1 6.0 7.0等。
contact.aspx

可广泛应用于低端智能POS、安防监控、车载设备、低端智能机器人、智能家居、智能硬件、工业智能手持设备、低端智能对讲设备、低端警务或执法设备、智能穿戴、贩卖机、物流柜、智能门禁系统等行业和设备。
contact.aspx

可提供以太网转串口透传,WIFI转串口透传,蓝牙转串口透传,CAN总线模拟量控制输出模块等。
contact.aspx

带3G或4G通讯功能,运行android系统,有多个串口,可以外挂各种模块:条码扫描、RFID、指纹识别、身份证识别、磁条卡、ID卡、GPS/北斗模块等。
contact.aspx

具有4G通讯功能,多个RS232或RS485接口,以太网接口,USB接口,CAN接口,多个AD输入。基于Android系统智能平台,方便APP应用开发。器件严格选型,运行稳定,质量可靠。
contact.aspx

error C2061: syntax error : identifier THIS_FILE
[VC 编程] 2008-04-20
 

0321 error C2061 error C2091 THIS_FILE NEW

加入同事的代码,结果:

o:\微软\vs6\vc98\include\new(35) : error C2061: syntax error : identifier THIS_FILE
o:\微软\vs6\vc98\include\new(35) : error C2091: function returns function
o:\微软\vs6\vc98\include\new(35) : error C2809: operator new has no formal parameters
o:\微软\vs6\vc98\include\new(36) : error C2061: syntax error : identifier THIS_FILE
o:\微软\vs6\vc98\include\new(37) : error C2091: function returns function
o: \微软\vs6\vc98\include\new(37) : error C2556: void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &) : overloaded function differs only by return type from void *(__cdecl *__cdecl operator new(void))(unsigned in
t)
        o:\微软\vs6\vc98\include\new(35) : see declaration of new
o:\微软\vs6\vc98\include\new(41) : error C2061: syntax error : identifier THIS_FILE
o:\微软\vs6\vc98\include\new(42) : error C2091: function returns function
o: \微软\vs6\vc98\include\new(42) : error C2556: void *(__cdecl *__cdecl operator new(void))(unsigned int,void *) : overloaded function differs only by return type from void *(__cdecl *__cdecl operator new(void))(unsigned int)
        o:\微软\vs6\vc98\include\new(35) : see declaration of new
o:\微软\vs6\vc98\include\new(42) : error C2809: operator new has no formal parameters
o:\微软\vs6\vc98\include\new(42) : error C2065: _P : undeclared identifier
o:\微软\vs6\vc98\include\memory(16) : error C2061: syntax error : identifier THIS_FILE
o:\微软\vs6\vc98\include\memory(17) : error C2091: function returns function
o: \微软\vs6\vc98\include\memory(17) : error C2784: void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257> &) : could not deduce template argument for void *(__cdecl *)(unsigned int,class std::alloca
tor<_Ty> &) from void *(__cdecl *)(unsigned int)
o: \微软\vs6\vc98\include\memory(17) : error C2785: void *(__cdecl *__cdecl operator new(void))(unsigned int,class std::allocator<`template-parameter257> &) and void *(__cdecl *__cdecl operator new(void))(unsigned int) have different return type
s
        o:\微软\vs6\vc98\include\memory(16) : see declaration of new
o:\微软\vs6\vc98\include\memory(17) : error C2809: operator new has no formal parameters
o:\微软\vs6\vc98\include\memory(20) : error C2954: template definitions cannot nest
Generating Code...
Error executing cl.exe.
Creating browse info file...


宏与头文件错误的冲突问题
程序如下:
// SisSocket.cpp : implementation file
//
#include "stdafx.h"
#include "DataServer.h"
#include "SisSocket.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "DataServerDlg.h"

经指点,将
// SisSocket.cpp : implementation file
//
#include "stdafx.h"
#include "DataServer.h"
#include "SisSocket.h"
#include "DataServerDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//...其他代码
问题解决,出在new重定义上
注:THIS_FILE为static char[],在debug时内容为本文件路径,供输出错误信息使用。

就是把
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

放到所有 INCLUDE 的后面


[VC 编程添加评论 | 评论/阅读(0/1517)
评论
昵称
主页
内容
递交


Copyright @ 我的开发笔记     2008 - 2017         粤ICP备19155526号-1