libxml-ruby problems

218 views
Skip to first unread message

Silas Baronda

unread,
Mar 4, 2011, 10:48:45 PM3/4/11
to RubyInstaller
I guys, I am trying to build libxml-ruby on my windows 7 box. I have
installed all the libraries from ftp://ftp.zlatkovic.com/libxml/ onto
my DevKit.

This is how far I am getting.

E:/work/Ruby187/bin/ruby.exe extconf.rb
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... yes
checking for inflate() in -lz... no
checking for inflate() in -lzlib... no
checking for inflate() in -lzlib1... yes
checking for iconv_open() in -liconv... no
checking for libiconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... yes
checking for libxml/xmlversion.h... yes
creating extconf.h
creating Makefile

make
gcc -shared -s -o libxml_ruby.so libxml.o ruby_xml.o ruby_xml_attr.o
ruby_xml_attributes.o ruby_xml_attr_decl.o ruby_xml_cbg.o
ruby_xml_document.o ruby_xml_dtd.o ruby_xml_encoding.o
ruby_xml_error.o ruby_xml_html_parser.o ruby_xml_html_parser_context.o
ruby_xml_html_parser_options.o ruby_xml_input_cbg.o ruby_xml_io.o
ruby_xml_namespace.o ruby_xml_namespaces.o ruby_xml_node.o
ruby_xml_parser.o ruby_xml_parser_context.o ruby_xml_parser_options.o
ruby_xml_reader.o ruby_xml_relaxng.o ruby_xml_sax2_handler.o
ruby_xml_sax_parser.o ruby_xml_schema.o ruby_xml_xinclude.o
ruby_xml_xpath.o ruby_xml_xpath_context.o ruby_xml_xpath_expression.o
ruby_xml_xpath_object.o ruby_xml_xpointer.o -L. -LE:/work/Ruby187/lib -
LE:/work/Ruby187/lib -L. -Wl,--enable-auto-image-base,--enable-auto-
import,--export-all -lmsvcrt-ruby18 -llibxml2 -liconv -lzlib1 -
lshell32 -lws2_32
ruby_xml_attr.o: In function `rxml_attr_value_get':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_attr.c:308:
undefined reference to `_imp__xmlFree'
ruby_xml_document.o: In function `rxml_document_encoding_set':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_document.c:311:
undefined reference to `_imp__xmlFree'
ruby_xml_document.o: In function `rxml_document_to_s':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_document.c:668:
undefined reference to `_imp__xmlFree'
ruby_xml_dtd.o: In function `rxml_dtd_initialize':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_dtd.c:234:
undefined reference to `_imp__xmlFree'
ruby_xml_namespaces.o: In function `rxml_namespaces_each':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_namespaces.c:134:
undefined reference to `_imp__xmlFree'
ruby_xml_node.o:c:/Development/src/libxml-ruby/ext/libxml/
ruby_xml_node.c:283: more undefined references to `_imp__xmlFree'
follow
ruby_xml_node.o: In function `rxml_node_output_escaping_q':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1144:
undefined reference to `_imp__xmlStringTextNoenc'
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1163:
undefined reference to `_imp__xmlStringTextNoenc'
ruby_xml_node.o: In function `rxml_node_output_escaping_set':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1196:
undefined reference to `_imp__xmlStringText'
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1196:
undefined reference to `_imp__xmlStringTextNoenc'
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1191:
undefined reference to `_imp__xmlStringText'
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1191:
undefined reference to `_imp__xmlStringTextNoenc'
ruby_xml_parser_context.o: In function
`rxml_parser_context_encoding_set':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_parser_context.c:
364: undefined reference to `_imp__xmlFree'
ruby_xml_sax_parser.o: In function `rxml_sax_parser_parse':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_sax_parser.c:103:
undefined reference to `_imp__xmlFree'
ruby_xml_xpath_context.o: In function
`rxml_xpath_context_register_namespaces_from_node':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_xpath_context.c:
164: undefined reference to `_imp__xmlFree'
ruby_xml_xpath_object.o: In function `rxml_xpath_object_free':
c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_xpath_object.c:40:
undefined reference to `_imp__xmlFree'
collect2: ld returned 1 exit status
make: *** [libxml_ruby.so] Error 1

Josi

unread,
Apr 11, 2011, 12:37:02 PM4/11/11
to RubyInstaller
Hi Silas,

I am having the exact same problem. Have you figured it out?

Thanks,
Jose
> lshell32 -lws2_32ruby_xml_attr.o: Infunction`rxml_attr_value_get':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_attr.c:308:
> undefined reference to `_imp__xmlFree'
> ruby_xml_document.o: Infunction`rxml_document_encoding_set':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_document.c:311:
> undefined reference to `_imp__xmlFree'
> ruby_xml_document.o: Infunction`rxml_document_to_s':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_document.c:668:
> undefined reference to `_imp__xmlFree'
> ruby_xml_dtd.o: Infunction`rxml_dtd_initialize':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_dtd.c:234:
> undefined reference to `_imp__xmlFree'
> ruby_xml_namespaces.o: Infunction`rxml_namespaces_each':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_namespaces.c:134:
> undefined reference to `_imp__xmlFree'
> ruby_xml_node.o:c:/Development/src/libxml-ruby/ext/libxml/
> ruby_xml_node.c:283: more undefined references to `_imp__xmlFree'
> follow
> ruby_xml_node.o: Infunction`rxml_node_output_escaping_q':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1144:
> undefined reference to `_imp__xmlStringTextNoenc'
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1163:
> undefined reference to `_imp__xmlStringTextNoenc'
> ruby_xml_node.o: Infunction`rxml_node_output_escaping_set':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1196:
> undefined reference to `_imp__xmlStringText'
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1196:
> undefined reference to `_imp__xmlStringTextNoenc'
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1191:
> undefined reference to `_imp__xmlStringText'
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_node.c:1191:
> undefined reference to `_imp__xmlStringTextNoenc'
> ruby_xml_parser_context.o: Infunction
> `rxml_parser_context_encoding_set':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_parser_context.c:
> 364: undefined reference to `_imp__xmlFree'
> ruby_xml_sax_parser.o: Infunction`rxml_sax_parser_parse':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_sax_parser.c:103:
> undefined reference to `_imp__xmlFree'
> ruby_xml_xpath_context.o: Infunction
> `rxml_xpath_context_register_namespaces_from_node':
> c:/Development/src/libxml-ruby/ext/libxml/ruby_xml_xpath_context.c:
> 164: undefined reference to `_imp__xmlFree'
> ruby_xml_xpath_object.o: Infunction`rxml_xpath_object_free':

cfis

unread,
Apr 23, 2011, 4:32:29 AM4/23/11
to RubyInstaller
Looks like you guys are missing either libxml2.dll.a or libxml2.dll on
your path.

Note the latest libxml-ruby comes with binary files, so you don't need
to compile it yourself.

Also note that its fairly easy to compile libxml2 itself using MinGw
(just follow the instructions in the win32 folder).

Thanks - Charlie

Luis Lavena

unread,
Apr 23, 2011, 8:46:25 AM4/23/11
to rubyin...@googlegroups.com
On Sat, Apr 23, 2011 at 5:32 AM, cfis <cf...@savagexi.com> wrote:
> Looks like you guys are missing either libxml2.dll.a or libxml2.dll on
> your path.
>
> Note the latest libxml-ruby comes with binary files, so you don't need
> to compile it yourself.
>

Thank you Charlie for the info.

Seems libxml-ruby 2.0.2 got released not long ago and contains
binaries for x86-mingw32, awesome!

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Charlie Savage

unread,
Apr 23, 2011, 1:09:19 PM4/23/11
to rubyin...@googlegroups.com, Luis Lavena

>
> Seems libxml-ruby 2.0.2 got released not long ago and contains
> binaries for x86-mingw32, awesome!

Yes. There is also a lib/libs folder that contains the binaries for all
the dependencies - so iconv, zlib and of course libxml2 itself. You'd
just have to copy and paste them to somewhere in your path.

Charlie

cfis

unread,
Apr 25, 2011, 1:56:31 PM4/25/11
to RubyInstaller
> While installing the gem libxml-ruby 1.1.4 for windows 7. This is for
> ruby on rails project.

Use 2.0.2 instead.

> I get error extconfig:missing zlib

This means you are trying to compile the gem. You can certainly do
that if you want, but you can skip the whole issue by installing the
binary version:

http://rubygems.org/gems/libxml-ruby/versions/2.0.2-x86-mingw32

> I'm not finding a stisfactory answer, where do you find the
> dependecies zlib and libxml headers and libraries and where do you
> paste them on my system?

If you want to compile the gem yourself, then you first need to
download, compile and install zlib and libxml. Both have build
scripts for windows that work with MinGW32, so its fairly easy to do.
But once again, if you install the binary version of libxml you can
avoid this.

Charlie

Charlie Savage

unread,
Apr 25, 2011, 9:54:26 PM4/25/11
to Swetha Nesari, rubyin...@googlegroups.com
> Hi,
> I do not see your solution in this link :
> http://groups.google.com/group/rubyinstaller/browse_thread/thread/a9ee5f64b0c222e4
>
> Is this the right link? I am using railsintaller.
> I tried libxml-ruby -v 2.0.2
> And libxml-ruby -v 2.0.2 --platform=x86-
> mingw32 as you suggested
> Installs fine.
> When i give 'bundle update' that's when i get the error :
> Failed to add native extensions libxml-ruby 1.1.4
> extconfig failure:zlib. And not able to run application.

Sounds like your bundler setup is wrong, you maybe asking for the wrong
version. Or maybe you are using a gem that requires the older version?
Check the gem.lock file.

Charlie

Reply all
Reply to author
Forward
0 new messages