无法构建代码块史密斯wxWidget项目

failed to build codeblocks smith wxWidget project

本文关键字:史密斯 wxWidget 项目 代码 构建      更新时间:2023-10-16

我正在尝试设置代码::块史密斯来做wxWidgets GUI编程。最近我在我的电脑上安装了code::blocks和wxWidget库。

code::blocks IDE version: 13.12
wxWidget version: 2.8.12
Operating System: Windows 7

下面是 wxWidget 项目的构建日志。我按照wxWidget网站上列出的说明进行操作,但没有工作。

-------------- Build: Debug in CsBarcodeScanner (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -D__WXDEBUG__ -IC:wxWidgets-2.8.12include -IC:wxWidgets-2.8.12libgcc_libmswud -c C:DataCsBarcodeScannerwx_pch.h -o wx_pch.h.gchDebug_wx_pch_h_gch
In file included from C:wxWidgets-2.8.12include/wx/platform.h:293:0,
                 from C:wxWidgets-2.8.12include/wx/defs.h:21,
                 from C:wxWidgets-2.8.12include/wx/wxprec.h:13,
                 from ./wx_pch.h:14,
                 from <command-line>:0:
C:wxWidgets-2.8.12include/wx/chkconf.h:1817:9: error: #error "wxClipboard requires wxDataObject"
Process terminated with status 1 (0 minute(s), 2 second(s))
1 error(s), 0 warning(s) (0 minute(s), 2 second(s))

你编辑过wx/setup.h文件吗?默认情况下,wxUSE_DATAOBJECT应设置为1,因此我看不出未修改的源如何发生此错误。

另外,我强烈建议使用 wxWidgets 3.0,绝对没有理由将 2.8 用于新项目。