簡體   English   中英

編譯來自winnt.h,winbase.h和excpt.h的windows mobile項目的錯誤

[英]Compile errors from winnt.h, winbase.h, and excpt.h for windows mobile project

我有成功編譯的桌面項目,但在我向項目添加新配置以支持Windows Mobile平台后,我收到以下錯誤:

error C2146: syntax error : missing ';' before identifier 'ContextRecord' winnt.h
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int winnt.h

error C2146: syntax error : missing ';' before identifier 'LPCONTEXT'   winbase.h
error C2040: 'PCONTEXT' : '_CONTEXT *' differs in levels of indirection from 'int'  excpt.h

該項目不包括winnt.h,但它包括windows.h,windbase.h。 我在谷歌搜索我必須更改項目屬性 - >配置屬性 - > C / C ++ - >預處理器 - >定義添加像_MBCS,或添加$( ARCHFAM ),$(ARCHFAM)。 或者通過將windows.h放在其他頭文件的頂部來改變我已經完成的頭文件的順序,但都沒有修復錯誤。

有什么建議可以解決這些問題嗎? 謝謝。

#include<windows.h>在所有這三個中,windows.h將它們全部拖入。這是你需要的唯一包含。 它涵蓋了所有windows api的80%,減去了os的一些專門的離散方面(例如直接2d,加密等)

我也遇到了這些錯誤。 我的問題是我忘了“;” 在我的一個頭文件中我的課程定義背后。

代替:

class myClass
{
   ...
};

我有:

class myClass
{
    ...
}

也許它有助於某人......

有必要手動糾正文件winnt.h中的語法錯誤

行:typedef void * POINTER_64 PVOID64;

我們更正:typedef void * POINTER_64,* PVOID64;

或者兩個:typedef void * POINTER_64; typedef void * PVOID64;

錯誤消失了

我的dll頭文件中有windows.h。
將它從頭文件中移出,只移入需要windows.h的.cpp項目中並且工作正常。

DLL的控制台測試應用程序在嘗試包含一堆Windows內容時生氣了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM