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.
首先,检查您的WxWidgets工程设置属性
If you plan to use both MFC and wxWidgets (and are using stdafx.h), make sure to have "include " above the MFC include lines. Otherwise, you may get errors about a "constant" in the CreateDialog function.
如果您计划使用MFC 如(CEdit, CString之类的),确保您的头文件中加入了include ,否则您可能会得到类似 "'constant' in the CreateDialog function"的编译错误。
Unlike MFC's CString::Format function, the wxString::Format function is a static member function. This means that calling "myStringInstance.Format(...)" will return the formatted text in a new wxString rather than change the string in the myStringInstance variable. You might be able to get away with a search and replace of ".Format(" to " = wxString::Format(" or ".Printf(" when porting your application.

There is a guide for porting an MFC application to wxWidgets.
以下是一个例子:从MFC程序移植为wxWidgets (Windows)程序。
http://wiki.wxwidgets.org/WxWidgets_For_MFC_Programmers#Dialog_Data_Handling

See Porting MFC applications to Linux.

至于从MFC程序移植为wxWidgets (Linux)程序,请看http://www-106.ibm.com/developerworks/library/l-mfc/?n-l-4182

最后总结:亲们,VC的wxWidgets项目出现error C2059编译错误时,只要确保您的头文件中加入include 就可以啦

你可能感兴趣的:(Code,collection)