0

任何包含库 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。

4

2 回答 2

1

您的 IDE 使用 GCC(可能是 MINGW 工具链)作为编译器,而您拥有的 WxWidgets 库是为 Visual Studio 编译器构建的。按照他们 wiki 上关于“使用 MinGW 编译 wxWidgets ”的说明创建与 GCC C++ 工具链兼容的版本。或者,您可以使用其中一个 Visual Studio 速成版作为您的 IDE。

于 2013-09-09T07:35:19.320 回答
0

您以某种方式进入$(WXWIN)\include\msvc了包含路径。当然,这条路径是特定于 MSVC 的,在使用 g++ 时根本不应该使用,就像错误消息告诉你的那样。

正如另一个回复所说,您最好的选择是按照 wiki 中的说明进行操作。但在任何情况下,您的编译器选项中都不应该有上述路径。

于 2013-09-09T12:25:19.353 回答