尚未声明附加控制台

AttachConsole has not been declared

本文关键字:控制台 未声明      更新时间:2023-10-16

我从这里得到了wxWidget的主分支。我从这里下载了tdm-gcc(我确定我使用的mingw32-make来自tdm-gcc内部)。按照wxWiki的指示,我在powershell上执行了(多次尝试)

mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release clean
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release

但是我不断收到错误

../../src/msw/app.cpp: In member function 'bool {anonymous}::wxConsoleStderr::DoInit()':
../../src/msw/app.cpp:416:11: error: '::AttachConsole' has not been declared
 if ( !::AttachConsole(ATTACH_PARENT_PROCESS) )
       ^
makefile.gcc:14269: recipe for target 'gcc_mswucorelib_app.o' failed
mingw32-make: *** [gcc_mswucorelib_app.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....

插入

#ifndef WINVER
    #define WINVER 0x0603
#endif
#ifndef _WIN32_WINNT
    #define _WIN32_WINNT 0x0603
#endif
#ifndef _WIN32_IE
    #define _WIN32_IE 0x0700
#endif

以前

#include <_mingw.h>

include/wx/msw/gccpriv.h.(这会将此部分 GitHub 拉取请求应用于分发的 wxWidgets 3.1.0。下一个 wxWidgets 版本,无论是 3.1.1 还是 3.2.0,都应该可以解决此问题。