error C2146: 语法错误: 缺少“;”(在标识符“PVOID64”的前面)

2023-11-29 04:59

本文主要是介绍error C2146: 语法错误: 缺少“;”(在标识符“PVOID64”的前面),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

借助邹宇华的双目标定程序的时候遇到了问题:“error C2146: 语法错误: 缺少“;”(在标识符“PVOID64”的前面)”(但在另一台电脑却可以运行)。

错误结果如图:


下面转载了http://blog.csdn.net/u013360881/article/details/51487895的解决方法:

跑程序遇见这个问题,查看错误根源说是PVOID64未定义,查找资料原因说是头文件搜索顺序引起的。网上有三种解决办法:

     一是在winnt.h文件中重新定义一边;

    二是platform SDK中的winnt.h,而DDK中的,vc6.0 自带的winnt.h有多个。 dxsdk 中的这些所用到的winnt.h版本不同。可通过调整IDE 工具-> 选项-> 项目vc++目录;包含文件include 的顺序来解决这类问题使dxsdk需要的winnt.h所在文件夹在最上面。也就是在IDE环境中把VC++包含目录DirectXsdk放在最后;

   三是在stdafx.h头文件前面中加入以下代码:(注:自我感觉博客中此处的代码并不完善

#define POINTER_64 __ptr64  
typedef unsigned __int64 POINTER_64_INT;  
#if defined(_WIN64)  
#define POINTER_32 __ptr32  
#else 

但这三种情况都没解决我的问题,可能不同的电脑配置环境不一样。首先第一种办法是最不可取的,系统文件最好不要轻易改动,否则后续code时会出错;而第二种方法在我的电脑中没找到DirectXsdk文件无法实施;于是采用第三种方法但按第三种这种方式还是无法通过编译,最后通过添加在stdafx.h的开头,加上以下代码通过编译:

#ifndef POINTER_64  #if !defined(_MAC) && (defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_VER >= 1100) && !(defined(MIDL_PASS) || defined(RC_INVOKED))  
#define POINTER_64 __ptr64  
typedef unsigned __int64 POINTER_64_INT;  
#if defined(_WIN64)  
#define POINTER_32 __ptr32  
#else  
#define POINTER_32  
#endif  
#else  
#if defined(_MAC) && defined(_MAC_INT_64)  
#define POINTER_64 __ptr64  
typedef unsigned __int64 POINTER_64_INT;  
#else  
#if (_MSC_VER >= 1300) && !(defined(MIDL_PASS) || defined(RC_INVOKED))  
#define POINTER_64 __ptr64  
#else  
#define POINTER_64  
#endif  
typedef unsigned long POINTER_64_INT;  
#endif  
#define POINTER_32  
#endif  
#endif  
按照上述博客方法成功运行。

这篇关于error C2146: 语法错误: 缺少“;”(在标识符“PVOID64”的前面)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/431542

相关文章

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

电脑提示msvcp90.dll缺少怎么办? MSVCP90.dll文件丢失的修复方法

《电脑提示msvcp90.dll缺少怎么办?MSVCP90.dll文件丢失的修复方法》今天我想和大家分享的主题是关于在使用软件时遇到的一个问题——msvcp90.dll丢失,相信很多老师在使用电脑时... 在计算机使用过程中,可能会遇到 MSVCP90.dll 丢失的问题。MSVCP90.dll 是 Mic

编译linux内核出现 arm-eabi-gcc: error: : No such file or directory

external/e2fsprogs/lib/ext2fs/tdb.c:673:29: warning: comparison between : In function 'max2165_set_params': -。。。。。。。。。。。。。。。。。。 。。。。。。。。。。。。。 。。。。。。。。 host asm: libdvm <= dalvik/vm/mterp/out/Inte

收藏:解决 pip install 出现 error: subprocess-exited-with-error 错误的方法

在使用 pip 安装 Python 包时,有时候会遇到 error: subprocess-exited-with-error 错误。这种错误通常是由于 setuptools 版本问题引起的。本文将介绍如何解决这一问题 当你使用 pip install 安装某个 Python 包时,如果 setuptools 版本过高或过低,可能会导致安装过程出错,并出现类似以下错误信息:error: subpr

Nn criterions don’t compute the gradient w.r.t. targets error「pytorch」 (debug笔记)

Nn criterions don’t compute the gradient w.r.t. targets error「pytorch」 ##一、 缘由及解决方法 把这个pytorch-ddpg|github搬到jupyter notebook上运行时,出现错误Nn criterions don’t compute the gradient w.r.t. targets error。注:我用

src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: 没有那个文件或目录

(venv) shgbitai@shgbitai-C9X299-PGF:~/pythonworkspace/ai-accompany$ pip install pyaudio sounddeviceCollecting pyaudioDownloading PyAudio-0.2.14.tar.gz (47 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ERROR 2003 (HY000): Can't connect to MySQL server on (10061)

在linux系统上装了一个mysql-5.5,启动后本机都是可以访问的,操作都正常,同时建了一个%的用户(支持远程访问), root@debian:/# mysql -u loongson -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id

pip install pyaudio sounddevice error: externally-managed-environment

shgbitai@shgbitai-C9X299-PGF:~/pythonworkspace/ai-accompany$ pip install pyaudio sounddeviceerror: externally-managed-environment× This environment is externally managed╰─> To install Python package

C++常见异常汇总(三): fatal error: google/protobuf/port_def.inc

文章目录 1、fatal error : sw/redis++/redis.h2、fatal error: dwarf.h: No such file or directory3、fatal error: elfutils/libdw.h: No such file or directory4、fatal error: libunwind.h: No such file or directo

error while loading shared libraries: libnuma.so.1: cannot open shared object file:

腾讯云CentOS,安装Mysql时: 1.yum remove libnuma.so.1 2.yum install numactl.x86_64