Feedback

type to search

Typhoeous Won't Build on Windows

Asked by

I’ve been going through the build instructions located here:

https://github.com/diaspora/diaspora/wiki/Installing-on-Windows-XP

I’ve gotten up to the Typhoeous section. Originally, Typhoeous would not compile cause it could not find the source code for libcurl. After figuring out that I had to download libcurl to a separate location, and then reference that location (as outlined here: https://github.com/dbalatero/typhoeus/issues/11) I am now getting a different error.

I believe the pertinent part of the error message is this:

checking for curl_easy_init() in -lcurl... no

You can see the full error output here:

C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4>gem install typhoeus -- --wit
h-opt-include=C:\temp\curl-7.19.4-devel-mingw32\include
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing typhoeus:
        ERROR: Failed to build gem native extension.

        C:/Ruby192/bin/ruby.exe extconf.rb --with-opt-include=C:\temp\curl-7.19.
4-devel-mingw32\include
checking for curl/curl.h in C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/c
ross/curl-7.19.4.win32/include... yes
checking for curl_easy_init() in -lcurl... no
creating Makefile

make
C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_native'"  > native-i386-mingw32.de
f
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -IC:\temp\curl-7.19.4-dev
el-mingw32\include    -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpo
inter-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -DXP
_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF -O3 -Wall -Wcast-qual -Wwrite-strings -
Wconversion -Wmissing-noreturn -Winline  -o native.o -c native.c
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -IC:\temp\curl-7.19.4-dev
el-mingw32\include    -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpo
inter-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -DXP
_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF -O3 -Wall -Wcast-qual -Wwrite-strings -
Wconversion -Wmissing-noreturn -Winline  -o typhoeus_easy.o -c typhoeus_easy.c
typhoeus_easy.c: In function 'read_callback':
typhoeus_easy.c:102:16: warning: comparison between signed and unsigned integer
expressions
typhoeus_easy.c:103:5: warning: conversion to 'size_t' from 'int' may change the
 sign of the result
typhoeus_easy.c:108:5: warning: conversion to 'size_t' from 'int' may change the
 sign of the result
typhoeus_easy.c:108:5: warning: conversion to 'int' from 'size_t' may change the
 sign of the result
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -IC:\temp\curl-7.19.4-dev
el-mingw32\include    -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpo
inter-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -DXP
_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF -O3 -Wall -Wcast-qual -Wwrite-strings -
Wconversion -Wmissing-noreturn -Winline  -o typhoeus_form.o -c typhoeus_form.c
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -IC:\temp\curl-7.19.4-dev
el-mingw32\include    -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpo
inter-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -DXP
_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF -O3 -Wall -Wcast-qual -Wwrite-strings -
Wconversion -Wmissing-noreturn -Winline  -o typhoeus_multi.o -c typhoeus_multi.c

typhoeus_multi.c: In function 'multi_read_info':
typhoeus_multi.c:72:15: warning: call to '_curl_easy_getinfo_err_string' declare
d with attribute warning: curl_easy_getinfo expects a pointer to char * for this
 info
gcc -shared -s -o native.so native.o typhoeus_easy.o typhoeus_form.o typhoeus_mu
lti.o -L. -LC:/Ruby192/lib -L/opt/local/lib -L. -LC:\\Users\\Luis\\Projects\\oss
\\oneclick\\rubyinstaller\\sandbox\\tk\\lib -LC:\\Users\\Luis\\Projects\\oss\\on
eclick\\rubyinstaller\\sandbox\\tcl\\lib -LC:\\Users\\Luis\\Projects\\oss\\onecl
ick\\rubyinstaller\\sandbox\\libyaml\\lib -LC:\\Users\\Luis\\Projects\\oss\\onec
lick\\rubyinstaller\\sandbox\\pdcurses\\lib -LC:\\Users\\Luis\\Projects\\oss\\on
eclick\\rubyinstaller\\sandbox\\openssl\\lib -LC:\\Users\\Luis\\Projects\\oss\\o
neclick\\rubyinstaller\\sandbox\\zlib\\lib -LC:\\Users\\Luis\\Projects\\oss\\one
click\\rubyinstaller\\sandbox\\iconv\\lib -LC:\\Users\\Luis\\Projects\\oss\\onec
lick\\rubyinstaller\\sandbox\\gdbm\\lib -LC:\\Users\\Luis\\Projects\\oss\\onecli
ck\\rubyinstaller\\sandbox\\libffi\\lib  -Wl,--enable-auto-image-base,--enable-a
uto-import native-i386-mingw32.def  -lmsvcrt-ruby191  -lshell32 -lws2_32
typhoeus_easy.o: In function `version':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
186: undefined reference to `_imp__curl_version'
typhoeus_easy.o: In function `easy_escape':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
182: undefined reference to `_imp__curl_easy_escape'
typhoeus_easy.o: In function `easy_add_header':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
149: undefined reference to `_imp__curl_slist_append'
typhoeus_easy.o: In function `easy_set_headers':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
157: undefined reference to `_imp__curl_easy_setopt'
typhoeus_easy.o: In function `easy_setopt_long':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
45: undefined reference to `_imp__curl_easy_setopt'
typhoeus_easy.o: In function `easy_setopt_form':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
36: undefined reference to `_imp__curl_easy_setopt'
typhoeus_easy.o: In function `easy_setopt_string':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
25: undefined reference to `_imp__curl_easy_setopt'
typhoeus_easy.o: In function `easy_set_request_body':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
171: undefined reference to `_imp__curl_easy_setopt'
typhoeus_easy.o: In function `easy_reset':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
134: undefined reference to `_imp__curl_slist_free_all'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
138: undefined reference to `_imp__curl_easy_reset'
typhoeus_easy.o: In function `set_response_handlers':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
118: undefined reference to `_imp__curl_easy_setopt'
typhoeus_easy.o: In function `easy_perform':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
86: undefined reference to `_imp__curl_easy_perform'
typhoeus_easy.o: In function `easy_getinfo_string':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
55: undefined reference to `_imp__curl_easy_getinfo'
typhoeus_easy.o: In function `easy_getinfo_double':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
77: undefined reference to `_imp__curl_easy_getinfo'
typhoeus_easy.o: In function `easy_getinfo_long':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
66: undefined reference to `_imp__curl_easy_getinfo'
typhoeus_easy.o: In function `curl_error_message':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
210: undefined reference to `_imp__curl_easy_strerror'
typhoeus_easy.o: In function `dealloc':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
12: undefined reference to `_imp__curl_slist_free_all'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
15: undefined reference to `_imp__curl_easy_cleanup'
typhoeus_easy.o: In function `new':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
190: undefined reference to `_imp__curl_easy_init'
typhoeus_easy.o: In function `set_response_handlers':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_easy.c:
118: undefined reference to `_imp__curl_easy_setopt'
typhoeus_form.o: In function `formadd_param':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_form.c:
32: undefined reference to `_imp__curl_formadd'
typhoeus_form.o: In function `formadd_file':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_form.c:
18: undefined reference to `_imp__curl_formadd'
typhoeus_form.o: In function `dealloc':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_form.c:
6: undefined reference to `_imp__curl_formfree'
typhoeus_multi.o: In function `multi_cleanup':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:181: undefined reference to `_imp__curl_multi_cleanup'
typhoeus_multi.o: In function `multi_remove_handle':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:47: undefined reference to `_imp__curl_multi_remove_handle'
typhoeus_multi.o: In function `multi_add_handle':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:17: undefined reference to `_imp__curl_multi_add_handle'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:22: undefined reference to `_imp__curl_easy_setopt'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:29: undefined reference to `_imp__curl_multi_perform'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:19: undefined reference to `_imp__curl_multi_strerror'
typhoeus_multi.o: In function `new':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:190: undefined reference to `_imp__curl_multi_init'
typhoeus_multi.o: In function `dealloc':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:6: undefined reference to `_imp__curl_multi_cleanup'
typhoeus_multi.o: In function `multi_read_info':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:63: undefined reference to `_imp__curl_multi_info_read'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:72: undefined reference to `_imp__curl_easy_getinfo'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:78: undefined reference to `_imp__curl_easy_getinfo'
typhoeus_multi.o: In function `multi_remove_handle':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:47: undefined reference to `_imp__curl_multi_remove_handle'
typhoeus_multi.o: In function `multi_read_info':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:74: undefined reference to `_imp__curl_easy_strerror'
typhoeus_multi.o: In function `multi_perform':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:130: undefined reference to `_imp__curl_multi_perform'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:137: undefined reference to `_imp__curl_multi_timeout'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c
:154: undefined reference to `_imp__curl_multi_fdset'
typhoeus_multi.o: In function `rb_curl_multi_run':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c:105: undefined reference to `_imp__curl_multi_strerror'typhoeus_multi.o: In function `multi_perform':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\exttyphoeus/typhoeus_multi.c:156: undefined reference to `_imp__curl_multi_strerror'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\ext\typhoeus/typhoeus_multi.c:139: undefined reference to `_imp__curl_multi_strerror'
typhoeus_multi.o: In function `rb_curl_multi_run':
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\exttyphoeus/typhoeus_multi.c
:101: undefined reference to `_imp__curl_multi_perform'
C:\Ruby192\lib\ruby\gems\1.9.1\gems\typhoeus-0.2.4\exttyphoeus/typhoeus_multi.c
:105: undefined reference to `_imp__curl_multi_strerror'    collect2: ld returned 1 exit status    make: *** [native.so] Error 1


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-
0.2.4 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/typhoeus-0.2.4/ext/typhoeu
s/gem_make.out

Any help trouble shooting this is appreciated.

NN comments
jbivins
-

In the libcurl section of the installation guide added a Vista/Windows 7 subsection. In it someone mentioned “make sure to delete libcurl.a from the lib directory in the curl folder and move bin/libcurl.dll there if you get gcc make/build errors.”

You may need to use Ruby 1.8.7. I wasn’t able to get it working with Ruby 1.9.

ben_gid
-
It looks like I was compiling with the wrong version of libcurl. Typhoeous is using a newer version then in that guide. I haven’t tried to recompile it yet with the newer version. It is currently built with libcurl 7.21.4 according to the author.

Also, I did delete thatlibcurl.a record, which did not seem to matter.

jbivins
-
When I use Ruby 1.9.2 I get the same error messages that you do. I haven’t found a way to fix the problem.

or Cancel

1 answer

0

open_id_942929 from Wrocław, Polska

Thanks a lot, Joe Bivins!

Benjamin Liyanage: Also, I did delete thatlibcurl.a record, which did not seem to matter.

You also have to “move bin/libcurl.dll there (to lib dir) if you get gcc make/build errors.”

Another thing is the —with-opt-dir option. In my case it was like this:

gem install typhoeus -- --with-opt-dir=d:\installs\curl-7.26.0-devel-mingw32

Of course curl-7.26.0-devel-mingw32\bin must be in your PATH directory.

or Cancel

Your answer

You need to join Diaspora to complete this action, click here to do so.