简体   繁体   中英

AttachConsole has not been declared

I got the master branch of wxWidget from here . I downloaded tdm-gcc from here (I am certain that mingw32-make which I've used is from inside tdm-gcc). Following the instruction from wxWiki I executed (many attempts) this on powershell

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

But I keep getting the error

../../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....

Insert

#ifndef WINVER
    #define WINVER 0x0603
#endif

#ifndef _WIN32_WINNT
    #define _WIN32_WINNT 0x0603
#endif

#ifndef _WIN32_IE
    #define _WIN32_IE 0x0700
#endif

before

#include <_mingw.h>

in include/wx/msw/gccpriv.h . (This applies some of this GitHub pull request to wxWidgets 3.1.0 as distributed. The next wxWidgets release, whether 3.1.1 or 3.2.0, should resolve this issue.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM