Unable to build w32
Development Environment Info
Windows 8 64-bit MinGW 32-bit gcc 4.8.1 go version go1.2 windows/386
Sample of Error Output
c:\mingw\include\ole2.h:70:52: error: unknown type name 'LPOLESTR' WINOLEAPI ReadFmtUserTypeStg(LPSTORAGE,CLIPFORMAT_,LPOLESTR_); ^ In file included from c:\mingw\include\rpcdce.h:33:0, from c:\mingw\include\rpc.h:65, from c:\mingw\include\windows.h:82, from c:\mingw\include\rpc.h:27, from c:\mingw\include\wtypes.h:29, from src\github.com\AllenDang\w32\user32.go:8: c:\mingw\include\ole2.h:80:41: error: expected ')' before 'const' WINOLEAPI OleCreateLinkToFile(LPCOLESTR,REFIID,DWORD,LPFORMATETC,LPOLECLIENTSITE,LPSTORAGE,PVOID_); ^ In file included from c:\mingw\include\windows.h:101:0, from c:\mingw\include\rpc.h:27, from c:\mingw\include\wtypes.h:29, from src\github.com\AllenDang\w32\user32.go:8: c:\mingw\include\ole2.h:81:38: error: unknown type name 'LPCOLESTR' WINOLEAPI OleCreateFromFile(REFCLSID,LPCOLESTR,REFIID,DWORD,LPFORMATETC,LPOLECLIENTSITE,LPSTORAGE,PVOID_); ^ c:\mingw\include\ole2.h:109:47: error: expected ')' before 'BOOL' WINOLEAPI_(HGLOBAL) OleGetIconOfFile(LPOLESTR,BOOL); ^ c:\mingw\include\ole2.h:110:48: error: unknown type name 'LPOLESTR' WINOLEAPI_(HGLOBAL) OleGetIconOfClass(REFCLSID,LPOLESTR,BOOL); ^ c:\mingw\include\ole2.h:111:59: error: unknown type name 'LPOLESTR' WINOLEAPI_(HGLOBAL) OleMetafilePictFromIconAndLabel(HICON,LPOLESTR,LPOLESTR,UINT); ^ c:\mingw\include\ole2.h:111:68: error: unknown type name 'LPOLESTR' WINOLEAPI_(HGLOBAL) OleMetafilePictFromIconAndLabel(HICON,LPOLESTR,LPOLESTR,UINT); ^ c:\mingw\include\ole2.h:112:44: error: unknown type name 'LPOLESTR' WINOLEAPI OleRegGetUserType(REFCLSID,DWORD,LPOLESTR_); ^ In file included from src\github.com\AllenDang\w32\user32.go:8:0: c:\mingw\include\wtypes.h:110:18: error: 'BSTR' redeclared as different kind of symbol typedef OLECHAR *BSTR; ^ In file included from c:\mingw\include\rpcdce.h:33:0, from c:\mingw\include\rpc.h:65, from c:\mingw\include\windows.h:82, from c:\mingw\include\rpc.h:27, from c:\mingw\include\wtypes.h:29, from src\github.com\AllenDang\w32\user32.go:8: c:\mingw\include\oleauto.h:231:1: note: previous declaration of 'BSTR' was here WINOLEAUTAPI_(BSTR) SysAllocStringByteLen(const char_,unsigned int); ^
Other Info
The above is only the bottom several lines of the error output, the actual output is over a thousand lines of similar errors. I'm not sure why these errors are occurring, as far as I know there is nothing wrong with my MinGW installation. This issue may still be on my side. If so, any help would be greatly appreciated.
@olekukonko I do not see how this could possibly be related to my issue.
From what I have looked at a big part of my issue must be related to the preprocessor. But how to fix it, or if it's fixable, is beyond my knowledge.
@drako0812 its a bit related ... am still doing some investigation on the issue, but this is the more reason why Terminal progress bar for Go should not depend on it for such a simple task ... so many other things not relating to screen size can make it fail
I managed to hack user32.go in a way that allowed w32 to build on my system.
The original was:
import (
// #include <wtypes.h>
// #include <winable.h>
"C"
"fmt"
"syscall"
"unsafe"
)
The modified version:
import (
// #include <windows.h>
"C"
"fmt"
"syscall"
"unsafe"
)
I'm not entirely sure why this worked except that some sort of preprocessor defines were affected.
If you using windows 64-bit then you need download go for amd64 architecture.