包含库WxWidgets的任何代码在“setup.h”库中总是出错,你能解释一下为什么吗?
in file included for c, 196
from c, 21
from c, 13
#error "This file should only be included when using Microsoft Visual C++"
wxCONCAT5(../../../lib/,wxCONCAT3(vc,, _lib), /,msw, /wx/setup.h): No such file or directory
293,
21,
13,
#error "wxUSE_DYNLIB_CLASS must be defined."
#error "wxUSE_EXCEPTIONS must be defined."
#error "wxUSE_FILESYSTEM must be defined."
#error "wxUSE_FS_ARCHIVE must be defined."
#error "wxUSE_DYNAMIC_LOADER must be defined."
#error "wxUSE_LOG must be defined."
#error "wxUSE_LONGLONG must be defined."
#error "wxUSE_MIMETYPE must be defined."
#error "wxUSE_PRINTF_POS_PARAMS must be defined."
#error "wxUSE_PROTOCOL must be defined."
#error "wxUSE_REGEX must be defined."
#error "wxUSE_STDPATHS must be defined."
#error "wxUSE_XML must be defined."
#error "wxUSE_SOCKETS must be defined."
#error "wxUSE_STREAMS must be defined."
#error "wxUSE_STOPWATCH must be defined."
#error "wxUSE_TEXTBUFFER must be defined."
#error "wxUSE_TEXTFILE must be defined."
#error "wxUSE_URL must be defined."
#error "wxUSE_VARIANT must be defined."
#error "wxUSE_ABOUTDLG must be defined."
#error "wxUSE_ACCEL must be defined."
#error "wxUSE_ANIMATIONCTRL must be defined."
#error "wxUSE_BITMAPCOMBOBOX must be defined."
#error "wxUSE_BMPBUTTON must be defined."
#error "wxUSE_BUTTON must be defined."
#error "wxUSE_CALENDARCTRL must be defined."
#error "wxMessageBox is always needed"
OnAbout(wxCommandEvent&)':
'wxMessageBox' was not declared in this scope
我有带有ide Falcon C ++的WxWidgets 2.8.12。
答案 0 :(得分:1)
您的IDE使用GCC(possibly MINGW toolchain)作为编译器,而您拥有的WxWidgets库是为Visual Studio编译器构建的。按照他们的维基上的说明进行操作" Compiling wxWidgets with MinGW"创建与GCC C ++工具链兼容的版本。或者,您可以使用其中一个Visual Studio Express版本作为IDE。
答案 1 :(得分:0)
你的包含路径中有$(WXWIN)\include\msvc
。当然,这条路径是MSVC特有的,在使用g ++时根本不应该使用,就像错误消息告诉你的那样。
正如另一个回复所说,最好的办法是遵循维基中的说明。但是在任何情况下都不应该在编译器选项中使用上述路径。