moovweb/gokogiri

gokogiri on windows full step

ckome opened this issue · 3 comments

1,install tdm64-gcc (http://downloads.sourceforge.net/project/tdm-gcc/TDM-GCC%20Installer/tdm64-gcc-4.8.1.exe?r=http%3A%2F%2Ftdm-gcc.tdragon.net%2F&ts=1380861880&use_mirror=superb-dca2)

2,modify $PATH,add gcc path (......tdm64-gcc\bin)

3,install GIMP 2 (http://jaist.dl.sourceforge.net/project/gimp-win/GIMP%20%2B%20GTK%2B%20%28stable%20release%29/GIMP%202.8.6/gimp-2.8.6-setup.exe)

4,unzip pkg-config to C:\Program Files\GIMP 2\bin (http://ftp.acc.umu.se/pub/gnome/binaries/win64/dependencies/pkg-config_0.23-2_win64.zip)

4.5 add C:\Program Files\GIMP 2\bin to $PATH

5,ADD $PKG_CONFIG_PATH (eg. e:\mygo\clib)

6,download
ftp://ftp.zlatkovic.com/libxml/64bit/libxml-2.9.1-win32-x86_64.7z
ftp://ftp.zlatkovic.com/libxml/64bit/iconv-1.14-win32-x86_64.7z
and unzip to e:\mygo\clib

directory tree like this:

E\mygo\clib
├─bin
├─include
│ └─libxml2
│ └─libxml
├─lib
│ └─pkgconfig
└─share
├─aclocal
├─doc
│ ├─libiconv
│ └─libxml2-2.9.1
│ ├─examples
│ └─html
│ ├─html
│ └─tutorial
│ └─images
│ └─callouts
├─gtk-doc
│ └─html
│ └─libxml2
└─man
├─man1
└─man3

modify libxml-2.0.pc (file path) ,and copy to your $PKG_CONFIG_PATH

prefix=e:/mygo/clib
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
modules=1

Name: libXML
Version: 2.9.1
Description: libXML library version2.
Requires:
Libs: -L${libdir} -lxml2
Libs.private: -L/usr/local/lib -lz -L/usr/local/lib -liconv -lws2_32
Cflags: -I${includedir}/libxml2 -I/usr/local/include

done


test:

cmd : gcc --version
display:
gcc (rev5, Built by TDM64-GCC project) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cmd:pkg-config --libs libxml-2.0
output: -Le:/mygo/clib/lib -lxml2


now,you can:
go get github.com/moovweb/gokogiri


the last !!!!!!!!!!
please copy the dll's to your go exe app directory from your clib\bin directory.

WTF!!!! This waste of my a week. see #47

thank you for your help, mdayaram.

sorry for my poor english. hope can help some guys.

Ah, I see, you were missing the libxml and the iconv libraries. Sorry this took so much of your time. Glad you got it working though =)

I did as close as I could but on last step I getting

$ go get github.com/moovweb/gokogiri
# github.com/moovweb/gokogiri/help
Documents\go\src\github.com\moovweb\gokogiri\help\help.go:6:25: fatal error: lib
xml/tree.h: No such file or directory
 #include <libxml/tree.h>
                         ^
compilation terminated.
# github.com/moovweb/gokogiri/xpath
Documents\go\src\github.com\moovweb\gokogiri\xpath\expression.go:4:26: fatal err
or: libxml/xpath.h: No such file or directory
 #include <libxml/xpath.h>
                          ^
compilation terminated.

why I can not download this FTP Links?