【发布时间】:2017-05-18 08:13:25
【问题描述】:
我从here 得到了 wxWidget 的 master 分支。我从here 下载了 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_mswu\corelib_app.o' failed
mingw32-make: *** [gcc_mswu\corelib_app.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....
【问题讨论】:
-
你有哪个版本的 TDM-GCC?一定是很旧的或者很新的,但我不知道是哪个...
-
尝试将
include/wx/msw/setup0.h复制到include/wx/msw/setup.h并重复mingw32-exe命令。 -
@VZ。我用过
tdm64-gcc-5.1.0-2,用tdm64-gcc-4.9.2-3至少让我摆脱了这个问题。 -
很奇怪,我确实看到
x86_64-w64-mingw32\include\wincon.h中的AttachConsole()声明作为 TDM-GCC 5.1.0 的一部分分发。不知道为什么编译器在那里找不到它,你能以某种方式破坏你的标题吗?
标签: c++ powershell gcc wxwidgets