I would like to create a small graphical interface with access to windows 7 32bit. This is what I did:
To verify the installation, I typed gcc at the command prompt. It returned a realgcc error : no input file , so it seems that gcc is installed correctly. Then I tried to run gtk-demo . It worked too
- My installation is tested and working fine. I have already developed a small server with it. GOROOT and GOPATH are installed correctly.
- To install go-gtk, I used
go get github.com/mattn/go-gtk/gtk
Installation completed with many warnings.
C: \ Users \ lhk> go get github.com/mattn/go-gtk/gtk
# github.com/mattn/go-gtk/glib
realgcc.exe: warning: '-xc' after the last input file has no effect
realgcc.exe: no input files
# github.com/mattn/go-gtk/gdk
realgcc.exe: warning: '-xc' after the last input file has no effect
realgcc.exe: no input files
# github.com/mattn/go-gtk/pango
realgcc.exe: warning: '-xc' after the last input file has no effect
realgcc.exe: no input files
C: \ Users \ LHK>
To test the go-gtk installation, I used a sample code here: http://mattn.imtqy.com/go-gtk/ . I tried to run this code with go run , but it completed the error message:
# github.com/mattn/go-gtk/glib
realgcc.exe: warning: '-xc' after the last input file does not affect realgcc.exe: no input files
# github.com/mattn/go-gtk/gdk
realgcc.exe: warning: '-xc' after the last input file does not affect realgcc.exe: no input files
# github.com/mattn/go-gtk/pango
realgcc.exe: warning: '-xc' after the last input file does not affect realgcc.exe: no input files
exit status 2
What I did wrong? How to configure gtk to use with go correctly?
Update
mb0 on the Go IRC channel really helped and pointed out this https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/GwbkQREiTZI
The go-gtk creator apparently got go-gtk to work on win32. He did not use. Instead, he cloned the github repository into the src folder on his GOPATH and used the mingw compiler shell to call mingw32-make.
I did the same: cloned the repo and named mingw32-make. It starts compiling, but does not appear with an error message:
# pkg-config --cflags gtksourceview-2.0
The gtksourceview-2.0 package was not found in the pkg-config search path.
Perhaps you should add a directory containing "gtksourceview-2.0.pc"
for the PKG_CONFIG_PATH environment variable
No package "gtksourceview-2.0" found exit status
1 mingw32-make: * [all] Error 2
This gives some specific recommendations. Obviously, there is a package configuration utility, and it does not find an important package. Unfortunately, I do not understand how to solve this. I checked the gtk site and found this article in pkg-config http://www.gtk.org/api/2.6/gtk/gtk-compiling.html
It seems to me that pkg-config is responsible for setting up import packages. Therefore, I hesitate to simply create the variable PKG_CONFIG_PATH, since I do not know where it should indicate. I just tried running shell commands in my mingw shell: pkg-config --cflags gtk+-2.0 and pkg-config --libs gtk+-2.0 . The first, apparently, displays a list of included paths, and the second just prints the available libraries. There are pango, cairo, gobject, pixbuf, and many others, but there is definitely no library called something like gtksourceview.
I assume that I do not have this library on my machine. This bothers me, as I downloaded and unpacked everything in one bundle, which was supposed to satisfy all the dependencies.
What can I do to solve this problem?