繁体   English   中英

MFC标头中的语法错误

[英]Syntax error in MFC header

我正在尝试编译pgpfone,而我从VS6迁移到VS2008,然后又迁移到VS2015的构建系统遇到了问题。

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /I.\ /I..\common /I..\bignum /I..\..\..\libs\pfl\win32 /I..\..\..\libs\pfl\common /I..\..\..\libs\pfl\common\util /ZI /nologo /W2 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _WINDOWS /D PGP_WIN32=1 /D PGPXFER=1 /D PGP_INTEL=1 /D BNINCLUDE=bni80386c.h /D _VC80_UPGRADE=0x0600 /Gm /EHsc /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo".\Debug/" /Fd".\Debug/vc140.pdb" /Gd /TP /analyze- /errorReport:queue ..\common\ADPCM.cpp ..\common\blowfish.cpp ..\common\bytefifo.cpp ..\common\cast5.cpp ..\common\CControlThread.cpp ..\common\CCounterEncryptor.cpp ..\common\CEncryptionStream.cpp ..\common\CMessageQueue.cpp ..\common\CPFPackets.cpp ..\common\CPFTransport.cpp ..\common\CPipe.cpp ..\common\CPriorityQueue.cpp ..\common\crc.cpp ..\common\CSoundInput.cpp ..\common\CSoundOutput.cpp ..\common\CXferThread.cpp ..\common\des3.cpp ..\common\dh.cpp ..\common\DHPrimes.cpp ..\common\fastpool.cpp ..\common\HashWordList.cpp ..\common\PGPFoneUtils.cpp ..\common\samplerate.cpp ..\common\SHA.cpp CAuthWindow.cpp CEncryptionDialog.cpp CFileTransferDialog.cpp CLevelMeter.cpp CModemDialog.cpp CPFTInternet.cpp CPFTSerial.cpp CPFWindow.cpp CPGPFone.cpp CPGPFoneFrame.cpp CPGPFStatusBar.cpp CPhoneDialog.cpp CSoundLight.cpp CStatusPane.cpp CTriThreshold.cpp CWinFilePipe.cpp CXferWindow.cpp LMutexSemaphore.cpp LSemaphore.cpp LThread.cpp PGPFWinUtils.cpp
  PGPFWinUtils.cpp
  _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
atlmfc\include\afxrendertarget.h(142): warning C4003: not enough actual parameters for macro 'IsNull' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C2059: syntax error: '(' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C2143: syntax error: missing ')' before '==' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C2143: syntax error: missing ',' before '==' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C2059: syntax error: '==' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C2059: syntax error: ')' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C2059: syntax error: '{' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]
atlmfc\include\afxrendertarget.h(142): error C2334: unexpected token(s) preceding '{'; skipping apparent function body [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]

这是完整的日志: https : //ci.appveyor.com/project/ysangkok/pgpfone

我如何找出导致错误的原因? 我假设PGPFWinUtils.cpp的代码包含错误地调用宏的标头,从而导致错误,但我不知道该在哪里。

使用Visual C ++是否可以获取宏回溯? 我记得Clang或GCC具有此功能。

这是完整的源代码: https : //github.com/ysangkok/pgpfone/blob/master/src/win32/PGPFWinUtils.cpp

我正在AppVeyor上进行编译,并且本地没有afxrendertarget.h的源。 如何下载Windows SDK以便在Ubuntu上进行标头检查?

atlmfc\include\afxrendertarget.h(142): warning C4003: not enough actual parameters for macro 'IsNull' [C:\projects\pgpfone\src\win32\PGPfone.vcxproj]

第一个错误提供了一些线索:

  • 线# 142afxrendertarget.h是成员函数的一字形定义BOOL IsNull() constCD2DSizeF ;

  • C4003指代宏IsNull的非法扩展。

这表明其他一些非MFC头文件#define是一个宏IsNull ,并且在该头包含在afxrendertarget.h之前(包括MFC头文件)的afxrendertarget.hIsNull宏会破坏IsNull成员函数声明。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM