go-gtk
go-gtk copied to clipboard
Success building and running on Windows....(not really an issue but might help someone else)
Steps:
- pull tip (as of today).
- Add this patch: http://codereview.appspot.com/4133041/
works!!
More detailed instructions:
If anyone wants to set up a build environment on windows, you need: MinGW and MSYS. An easy way (but 32 bit only and a bit 'non-standard'), is to use this installer: http://sourceforge.net/projects/lunac/files
If you don't use this installer the paths you need to use will be different than the ones I use!
Get and unzip into the top level directory, bison, diffutils, ed from the Gnuwin32 project. You need the binaries, the dev packages and the dependancies!
Use Tortoisehg or command line hg to pull the latest go source to C:\MinGW\go Set the environment variables needed for go: GOARCH set to: 386 GOBIN set to: C:/MinGW/go/bin GOOS set to: windows GOROOT set to: C:/MinGW/go
Add the patch at: http://codereview.appspot.com/4133041/ (I'll add the steps required to do this if anyone really cares) ;)
Build go by launching MSYS using C:\MinGW\msys.bat and cd to /go/src and entering the command ./all.bash
Get gtk+ from here: http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip
You also need both the bin and dev files from here: http://ftp.acc.umu.se/pub/gnome/binaries/win32/gtksourceview/2.10/ and from here: http://ftp.acc.umu.se/pub/gnome/binaries/win32/dependencies/ you need the bin and dev files for the libxml2 library.
Unpack all of these into C:\MinGW\gtk+, then follow the directions in the gtk+-bundle_2.22.1-20101227_win32.README.txt to make pkg-configure happy.
Copy the msys.bat file at C:\MinGW to msysgo.bat and add set GOBIN=/go/bin set GOROOT=/go near the top.
Pull the latest version of go-gtk using TortoiseGit or command line git to: C:\MinGW\go-gtk. Then start MSYS again using the msysgo.bat file...and cd /go-gtk and follow the directions in the README.md file to
I had to copy the zlib1.dll file from C:\MinGW\gtk+\bin into the examples before they would run.
I hope this helps! If it is too complex, just wait and I'm sure someone will get a pre-packaged windows installer going sometime soon...
Great! I did also as your said. :) And I feed that this installation is too difficult for many people. I want to add installation help. that's todo! Thanks.
as of release 32e6fff7fbb3 on Thu Feb 10 20:39 no patching is required. You can just get the latest version of the go source, compile go and then go-gtk works on windows! Now for a dumb question: Is there anyway to suppress the console?
Thanks,
David
Thanks you too. However, I must add install manual for windows user. I'll keep this issue.
I was able to set up a good build environment by installing MinGW from their standard installer (dated 02-11-2011). I checked off the C++ compiler (for other projects), and MSYS Basic System and MinGW Developer Toolkit. I only need to add ed and it's depandancies from Gnuwin32 into C:\MinGW\msys\1.0\bin (just ed.exe and regex2.dll). I then grabbed the go source and put it at C:\MinGW\go and was able to compile it with no issues. I use a batch file called msysgo.bat located at C:\MinGW to adjust some go environment variables and start bash.
set GOBIN=/c/MinGW/go/bin
set GOROOT=/c/MinGW/go
C:\MinGW\msys\1.0\msys.bat
I was then able to build go-gtk following the same methods as my first post.
It's ALMOST getting easy :)
Thanks for your report!
You can set GOBIN and GOROOT in /etc/profile.d/anyscriptname.sh (assuming that /etc/profile does run scripts in profile.d ; stock /etc/profile from Msys does that, but you might have modified it after that)
nice article to me
I had some problems understanding this article. I'm on Windows 8 and can't comprehend why I would need to install a Linux system under Windows. All I need for developing Go programs, I believe, is the Go library and compiler (which already runs under Windows, right?), a separate file system tree for development files, an editor, and an optional batch file to set up environment variables. What am I missing in my understanding? I don't think I need any source control system, since I will just be experimenting for some time.
Go seems available native for Windows, so no form of Linux is needed, right?
And your step one, "pull tip", makes no sense. What are the definitions of these words? Am I seeing in issue 42 only part of a larger piece of advice?
Finally, what is this patch (fix mmap breakage on Windows) for? There is no explanation. What is being patched? Do I really need this patch for general programming?
I would think that help for Windows users should make sense for Windows users. Yes?
I'm going to proceed to see if I can set up a development environment for Go following the Go documentation. If I fail, I will assume it is because it can't actually be done and I will abandon Go.
Is that reasonable? Seems so to me. Anyway, it's now two years later, so this posting might not even be relevant anymore.
On 06/20/2014 11:12 AM, David263 wrote:
I had some problems understanding this article. I'm on Windows 8 and can't comprehend why I would need to install a Linux system under Windows. All I need for developing Go programs, I believe, is the Go library and compiler (which already runs under Windows, right?), a separate file system tree for development files, an editor, and an optional batch file to set up environment variables. What am I missing in my understanding? I don't think I need any source control system, since I will just be experimenting for some time.
Go seems available native for Windows, so no form of Linux is needed, right? I'm a big fan of golang and go-gtk. As a result it's my pleasure to convey to you that golang really is a lot of fun to use WHEN YOU ARE RUNNING IT ON THE RIGHT OPERATING SYSTEM. GNU/Linux is the RIGHT OPERATING SYSTEM. Windows has been the wrong operating system since GNU/Linux came out in the early nineties. Any government still using MS software now implies some government officials being corrupted/given some under-the-table perks.
Microsoft in the past AND PRESENT has always been against open-source. Never believe Microsoft is open-source because that's just a hook-line-sinker ploy to get people using windows and pay for Microsoft product and upgrades and support again. google "embrace extend extinguish microsoft", "halloween papers" and "microsoft linux fud" and you'll find a long history about Microsoft being evil towards small innovative companies and the open-source GNU/Linux movement. There is more SYNERGY in the GNU/LINUX community now. GNU/Linux users will always remain vigilant towards Microsoft and so should you remain vigilant if you want to save more money in your wallet.
In order to use golang to its full extent, ASSUME you must use Linux compatibility tools in your windows environment. You must INSTALL cygwin on windows.
And your step one, "pull tip", makes no sense. What are the definitions of these words? Am I seeing in issue 42 only part of a larger piece of advice?
Finally, what is this patch (fix mmap breakage on Windows) for? There is no explanation. What is being patched? Do I really need this patch for general programming? patch is very old jargon from pre-Linux days found in the UNIX flavors. patch is one of a plethora of small "one-tool for one-job" tools in the UNIX/POSIX/LINUX toolset. The sooner you adapt and learn GNU/LINUX, the more productive you will truly be. Don't waste your time learning Microsoft Marketing Buzzword vaporware you'll end up PAYING through the nose for. I suggest you download a Debian or Ubuntu GNU/Linux LIVE iso and then put it on a blank USB 3.0 Thumb Drive to see what all the fuss is about. All the documentation for all the software is in the Linux repositories. You just need to read them. That said, when someone gives you a recipe to follow, they mean to save you time to get up and running usually. If they mention to apply a patch, then it is best to follow the advice.
I would think that help for Windows users should make sense for Windows users. Yes? No, you're implying those building apps for windows actually like windows. If you are a linux developer, then you would understand Linux is much more delightful to use than windows any day of the week, but Linux developers simply want to make their app exist in windows for those luddites not tech-savvy enough who haven't moved to GNU/Linux desktop yet. I'm being deliberately condescending here because why would anyone one earth pay for an os and software that another community volunteers to make and give away a similar alternative? It's like I said above: it's because some higher-up in the government got a fat-envelope of $$$ to impose Microsoft software on its populace. That's why.
I'm going to proceed to see if I can set up a development environment for Go following the Go documentation. If I fail, I will assume it is because it can't actually be done and I will abandon Go. I'll consider this email a flame and answer it accordingly. I have experience with basic, assembler, c, c++, sql, java, perl, python, ada, lex, yacc, antlr, javacc and golang. The language I have had the most fun with is definitely golang. Abandoning golang because you prefer windows makes you an idiot. Try a real operating system: GNU/Linux with golang.
I have enjoyed golang on GNU/Linux with qt/qml, gtk, mongodb, networking/webserver and json/xml. ALL OF THESE EXTREMELY USEFUL IN REAL-WORLD APPLICATION PROGRAMMING AND SAVING ME LOTS OF TIME.
I haven't touched windows and cygwin in years, but I have done time-saving work with cygwin on windows using c++/gtk/perl/python/x/gimp and at times in combination with powershell. I can vouch cygwin certainly saves GNU/Linux developers much time when targeting apps for windows.
Much to learn grasshopper.
Is that reasonable? Seems so to me.
I'm condescending you here because you are not reasonable. You actually are trying to rationalize others to believe golang is crap because it's not working just for you on windows.
There are number of golang users that attended gophercon2014 that would beg to differ with you I am certain of that.
Wake UP! It's 2014! There's more than Microsoft Windows out there for golang and gtk to run on, but if you must golang/gtk on windows, then cygwin will help you get there.
@David263 I make my own answer to limit @omac777 answer that I feel too brutal :)
Ok, I'm a C/C++, Perl, Python, PHP, JS, Java developper and I'm a fan of Golang for 2 years (excuse my english). I'm a Linux user (no windows since 1999) but I use to make some tests on Windows. That's my work, I must think about Windows users.
I guess you are confusing about Go, and Go-Gtk. Go/Golang is a language that is windows compatible. You can develop without any Cygwin/Linux installation. But ! GTK is a Toolkit designed for Linux. It was ported to Windows to compile The Gimp. What Go-GTK need to be able to compile a Windows binary is to have good links to GTK library. Because Golang is statically compiled, you must have GTK devel files (dlls, headers, static libraries).
For now, GoGTK is designed to get GTK bindings from Linux implementation, Windows Implementation is not exactly the same.
To have static libraries from GTK, you need to compile sources. And the problem is that, as I said before, GTK is originaly a Linux library... Windows compilers are not very well designed to compile that kind of libraries. So, to be able to compile GTK, and so to allow Go compiler to link libraries, you need a compiler that is able to make the link edition. That's why MingW, Cygwin and other tools should be installed on you Windows host.
As soon as you have succefully installed (and maybe patched) that installation, you can use GoGTK.
Keep in mind that GoGTK is not "Go", and that the problem is Windows, not GTK... Keep in mind that you can use Go on windows without Linux.
I'm developping some tools in Go that works great on Windows... I (at this time) don't use GoGTK on Windows. But you can try GoQML while GoGTK is not (at this time) ready to be easilly used on Windows if you're not ready to spend time to make a build environnement.
Sorry for my bad english.