-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Building on Windows
l1n3n01z edited this page Nov 6, 2013
·
23 revisions
This article is a stub and is based on the discussion in #119!
TODO: all of this installation is quite polluting. It should be possible to keep it all in one directory, and use bat files to set correct paths and variables etc before building.
Building on windows requires mingw, currently it is only possible to use 32 bit version of mingw for qt5, so for now we are confined to 32 bit setup, even on 64 bit Windows.
- install mingw32/msys mingw32(because qt5 for mingw only has 32bit): http://sourceforge.net/projects/mingw/files/latest/download
- install Qt for mingw32 here: http://download.qt-project.org/official_releases/qt/5.1/5.1.1/
- download pkg-config from http://sourceforge.net/projects/pkgconfiglite/files/ and select the latest version and extract to c:\MinGW\bin
- download glib bin and dev version from http://www.gtk.org/download/win32.php and extract content to c:\MinGW
- uninstall Go amd64 if it is installed and install Go386 instead: https://code.google.com/p/go/downloads/detail?name=go1.2rc2.windows-386.msi
- set GOARCH=386
- set CPATH=C:\MinGW\include;C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include;C:\Qt\Qt5.1.1\5.1.1\mingw48_32\include\QtCore\5.1.1\QtCore
- set LIBRARY_PATH=C:\MinGW\lib;C:\Qt\Qt5.1.1\5.1.1\mingw48_32\lib
- set PATH=C:\Qt\Qt5.1.1\5.1.1\mingw48_32\bin;C:\MinGW\bin;%path% (!important, put Qt's path in front of MinGW's path otherwise it'll complain libstdc++-6.dll missing as Qt's path contains a different libstd++-6.dll)
- Download and install python3 win32 from http://www.python.org/download/
- Download pexport (bin version) from http://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/pexports-0.46/ and extract to c:\MinGW
- Start msys shell(usually located at C:\MinGW\msys\1.0\msys.bat)and run pexports to create a static linking library from python dll:
$ mount c:/mingw32 /mingw
$ pexports /c/Windows/SysWOW64/python33.dll >py33.def
$ dlltool -D python33.dll -d py33.def -l libpython33.a
$ cp libpython33.a c:/mingw/lib
- Download libffi from ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz and extract it to anywhere
- Start msys shell(usually located at C:\MinGW\msys\1.0\msys.bat) cd to the extracted directory and run:
$ mount c:/mingw32 /mingw
$ ./configure --prefix=/mingw
$ make
$ make install
package py
// #cgo CFLAGS: -Ic:/python33/include
// #cgo LDFLAGS: -Lc:/Python33/libs -Lc:/mingw/lib -ldl -lpython33
// #cgo pkg-config: libffi
import "C"
Run go test from gopy as stated in regular build instructions.