I'm having troubling installing the pg gem on Windows 10.
I've looked around and was able to progress with the first set of errors, but now am stuck with the error shown below.
Most answers I found all are for Linux and OSX and usually revolve around installing libpq-dev,which I'm not able to find for Windows. Given that I've moved past the initial missing libpq-fe.h error, I'm assuming that the required dev files are already included in the Windows installer.
I've tried specifying the folder/lib locations several ways, including:
gem install pg -v '1.1' -- --with-pg-dir="C:\Program Files\PostgreSQL\13" --with-pq-dir="C:\Program Files\PostgreSQL\13"
and
gem install pg -v '1.1' -- --with-pg-config="C:\Program Files\PostgreSQL\13\bin\pg_config.exe"
But neither seem to work. Any suggestions?
Additional info:
Console output
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions with: '--with-pg-config=C:\Program Files\PostgreSQL\13\bin\pg_config.exe'
This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby30/lib/ruby/gems/3.0.0/gems/pg-1.1.0/ext
C:/Ruby30/bin/ruby.exe -I C:/Ruby30/lib/ruby/3.0.0 -r ./siteconf20210424-18200-bi9e9l.rb extconf.rb --with-pg-config\=C:\\Program\ Files\\PostgreSQL\\13\\bin\\pg_config.exe
Using config values from C:\Program Files\PostgreSQL\13\bin\pg_config.exe
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
mkmf.log
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby300 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return !!argv[argc];
8: }
/* end */
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -lmsvcrt-ruby300 -Wl,-rpath,C:/PROGRA~1/POSTGR~1/13/lib -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */
find_header: checking for libpq-fe.h... -------------------- yes
"i686-w64-mingw32-gcc -E -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq-fe.h>
/* end */
--------------------
find_header: checking for libpq/libpq-fs.h... -------------------- yes
"i686-w64-mingw32-gcc -E -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq/libpq-fs.h>
/* end */
--------------------
find_header: checking for pg_config_manual.h... -------------------- yes
"i686-w64-mingw32-gcc -E -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <pg_config_manual.h>
/* end */
--------------------
have_library: checking for PQconnectdb() in -lpq... -------------------- no
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -Wl,-rpath,C:/PROGRA~1/POSTGR~1/13/lib -lmsvcrt-ruby300 -lpq -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
C:/Ruby30/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:\Users\crist\AppData\Local\Temp\cch5p7v1.o:conftest.c:(.text+0x7): undefined reference to `PQconnectdb'
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq-fe.h>
6:
7: /*top*/
8: extern int t(void);
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: int (* volatile tp)(void)=(int (*)(void))&t;
13: printf("%d", (*tp)());
14: }
15:
16: return !!argv[argc];
17: }
18: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return !p; }
/* end */
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -Wl,-rpath,C:/PROGRA~1/POSTGR~1/13/lib -lmsvcrt-ruby300 -lpq -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c:18:13: error: conflicting types for 'PQconnectdb'
18 | extern void PQconnectdb();
| ^~~~~~~~~~~
In file included from conftest.c:5:
C:/PROGRA~1/POSTGR~1/13/include/libpq-fe.h:264:16: note: previous declaration of 'PQconnectdb' was here
264 | extern PGconn *PQconnectdb(const char *conninfo);
| ^~~~~~~~~~~
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq-fe.h>
6:
7: /*top*/
8: extern int t(void);
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: int (* volatile tp)(void)=(int (*)(void))&t;
13: printf("%d", (*tp)());
14: }
15:
16: return !!argv[argc];
17: }
18: extern void PQconnectdb();
19: int t(void) { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -llibpq... -------------------- no
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -Wl,-rpath,C:/PROGRA~1/POSTGR~1/13/lib -lmsvcrt-ruby300 -llibpq -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
C:/Ruby30/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:\Users\crist\AppData\Local\Temp\cc4PD9EV.o:conftest.c:(.text+0x7): undefined reference to `PQconnectdb'
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq-fe.h>
6:
7: /*top*/
8: extern int t(void);
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: int (* volatile tp)(void)=(int (*)(void))&t;
13: printf("%d", (*tp)());
14: }
15:
16: return !!argv[argc];
17: }
18: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return !p; }
/* end */
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -Wl,-rpath,C:/PROGRA~1/POSTGR~1/13/lib -lmsvcrt-ruby300 -llibpq -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c:18:13: error: conflicting types for 'PQconnectdb'
18 | extern void PQconnectdb();
| ^~~~~~~~~~~
In file included from conftest.c:5:
C:/PROGRA~1/POSTGR~1/13/include/libpq-fe.h:264:16: note: previous declaration of 'PQconnectdb' was here
264 | extern PGconn *PQconnectdb(const char *conninfo);
| ^~~~~~~~~~~
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq-fe.h>
6:
7: /*top*/
8: extern int t(void);
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: int (* volatile tp)(void)=(int (*)(void))&t;
13: printf("%d", (*tp)());
14: }
15:
16: return !!argv[argc];
17: }
18: extern void PQconnectdb();
19: int t(void) { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -Wl,-rpath,C:/PROGRA~1/POSTGR~1/13/lib -lmsvcrt-ruby300 -lms/libpq -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
C:/Ruby30/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lms/libpq
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq-fe.h>
6:
7: /*top*/
8: extern int t(void);
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: int (* volatile tp)(void)=(int (*)(void))&t;
13: printf("%d", (*tp)());
14: }
15:
16: return !!argv[argc];
17: }
18: int t(void) { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return !p; }
/* end */
"i686-w64-mingw32-gcc -o conftest.exe -IC:/Ruby30/include/ruby-3.0.0/i386-mingw32 -IC:/Ruby30/include/ruby-3.0.0/ruby/backward -IC:/Ruby30/include/ruby-3.0.0 -I. -IC:/PROGRA~1/POSTGR~1/13/include -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -fstack-protector-strong conftest.c -L. -LC:/Ruby30/lib -LC:/PROGRA~1/POSTGR~1/13/lib -L. -pipe -s -fstack-protector-strong -Wl,-rpath,C:/PROGRA~1/POSTGR~1/13/lib -lmsvcrt-ruby300 -lms/libpq -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c:18:13: error: conflicting types for 'PQconnectdb'
18 | extern void PQconnectdb();
| ^~~~~~~~~~~
In file included from conftest.c:5:
C:/PROGRA~1/POSTGR~1/13/include/libpq-fe.h:264:16: note: previous declaration of 'PQconnectdb' was here
264 | extern PGconn *PQconnectdb(const char *conninfo);
| ^~~~~~~~~~~
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <libpq-fe.h>
6:
7: /*top*/
8: extern int t(void);
9: int main(int argc, char **argv)
10: {
11: if (argc > 1000000) {
12: int (* volatile tp)(void)=(int (*)(void))&t;
13: printf("%d", (*tp)());
14: }
15:
16: return !!argv[argc];
17: }
18: extern void PQconnectdb();
19: int t(void) { PQconnectdb(); return 0; }
/* end */
--------------------
The issue was apparently being caused because I was using the 32 bit version of Ruby. Installed the 64 bit and the issue was resolved.
I am trying to build website using Jekyll in Github Pages, I have issues installing github-pages gem in my local machine Windows 7 x64 Enterprise version.
Here is the steps I took:
* installed ruby 2.1.7 32bit at c:\Ruby21\ (file rubyinstaller-2.1.7.exe)
* installed corresponding devkit at c:\Devkit\ (file DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe)
* run “gem install json --platform=ruby” to install RubyGems library JSON
* confirm JSON gem ok: ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect, I got response 42.
run “gem install bundler”, installed ok.
I went to local repo, created a Gemfile with content:
source 'https://rubygems.org'
gem 'github-pages'
run "bundle install"
The last run was failed with following message:
Installing rdiscount 2.1.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/Ruby21/bin/ruby.exe extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... 4
checking size of unsigned int... failed
checking size of unsigned short... failed
no int with size 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby21/bin/ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/lib
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/rdiscount-2.1.7 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/rdiscount-2.1.7/gem_make.out
An error occurred while installing rdiscount (2.1.7), and Bundler cannot
continue.
Make sure that `gem install rdiscount -v '2.1.7'` succeeds before bundling.
Below is the content of the file gem_make.out:
have_func: checking for random()... -------------------- no
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'random' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))random; return 0; }
/* end */
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'random' [-Wimplicit-function-declaration]
C:\Users\xxxxx\AppData\Local\Temp\ccvoe3lp.o: In function `t':
C:\Ruby21\lib\ruby\gems\2.1.0\gems\rdiscount-2.1.7\ext/conftest.c:16: undefined reference to `random'
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { random(); return 0; }
/* end */
--------------------
have_func: checking for srandom()... -------------------- no
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'srandom' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))srandom; return 0; }
/* end */
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'srandom' [-Wimplicit-function-declaration]
C:\Users\xxxxx\AppData\Local\Temp\ccPnlJQk.o: In function `t':
C:\Ruby21\lib\ruby\gems\2.1.0\gems\rdiscount-2.1.7\ext/conftest.c:16: undefined reference to `srandom'
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { srandom(); return 0; }
/* end */
--------------------
have_func: checking for rand()... -------------------- yes
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))rand; return 0; }
/* end */
--------------------
have_func: checking for srand()... -------------------- yes
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))srand; return 0; }
/* end */
--------------------
check_sizeof: checking size of unsigned long... -------------------- 4
"gcc -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -c conftest.c"
conftest.c:9:5: error: size of array 'conftest_const' is negative
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: typedef unsigned long rbcv_typedef_;
6: static rbcv_typedef_ *rbcv_ptr_;
7:
8: /*top*/
9: int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
/* end */
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: typedef unsigned long rbcv_typedef_;
6: static rbcv_typedef_ *rbcv_ptr_;
7:
8: #include <stdio.h>
9: /*top*/
10: typedef unsigned
11: #ifdef PRI_LL_PREFIX
12: #define PRI_CONFTEST_PREFIX PRI_LL_PREFIX
13: LONG_LONG
14: #else
15: #define PRI_CONFTEST_PREFIX "l"
16: long
17: #endif
18: conftest_type;
19: conftest_type conftest_const = (conftest_type)(sizeof((*rbcv_ptr_)));
20: int main() {printf("%"PRI_CONFTEST_PREFIX"u\n", conftest_const); return 0;}
/* end */
./conftest |
--------------------
check_sizeof: checking size of unsigned int... -------------------- failed
"gcc -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -c conftest.c"
conftest.c:9:5: error: size of array 'conftest_const' is negative
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: typedef unsigned int rbcv_typedef_;
6: static rbcv_typedef_ *rbcv_ptr_;
7:
8: /*top*/
9: int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
/* end */
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
c:/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot open output file conftest.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: typedef unsigned int rbcv_typedef_;
6: static rbcv_typedef_ *rbcv_ptr_;
7:
8: #include <stdio.h>
9: /*top*/
10: typedef unsigned
11: #ifdef PRI_LL_PREFIX
12: #define PRI_CONFTEST_PREFIX PRI_LL_PREFIX
13: LONG_LONG
14: #else
15: #define PRI_CONFTEST_PREFIX "l"
16: long
17: #endif
18: conftest_type;
19: conftest_type conftest_const = (conftest_type)(sizeof((*rbcv_ptr_)));
20: int main() {printf("%"PRI_CONFTEST_PREFIX"u\n", conftest_const); return 0;}
/* end */
--------------------
check_sizeof: checking size of unsigned short... -------------------- failed
"gcc -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -c conftest.c"
conftest.c:9:5: error: size of array 'conftest_const' is negative
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: typedef unsigned short rbcv_typedef_;
6: static rbcv_typedef_ *rbcv_ptr_;
7:
8: /*top*/
9: int conftest_const[(sizeof((*rbcv_ptr_)) < 0) ? 1 : -1];
/* end */
"gcc -o conftest.exe -IC:/Ruby21/include/ruby-2.1.0/i386-mingw32 -IC:/Ruby21/include/ruby-2.1.0/ruby/backward -IC:/Ruby21/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby21/lib -L. -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
c:/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot open output file conftest.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: typedef unsigned short rbcv_typedef_;
6: static rbcv_typedef_ *rbcv_ptr_;
7:
8: #include <stdio.h>
9: /*top*/
10: typedef unsigned
11: #ifdef PRI_LL_PREFIX
12: #define PRI_CONFTEST_PREFIX PRI_LL_PREFIX
13: LONG_LONG
14: #else
15: #define PRI_CONFTEST_PREFIX "l"
16: long
17: #endif
18: conftest_type;
19: conftest_type conftest_const = (conftest_type)(sizeof((*rbcv_ptr_)));
20: int main() {printf("%"PRI_CONFTEST_PREFIX"u\n", conftest_const); return 0;}
/* end */
--------------------
I don't have background on c. I am not sure what the issue is and how to fix it.
Any help is appreciated!
PS:
I've tried different Ruby versions(2.1.7/2.2.3) and x86/x64, all resulted the same error. I also tried in another machine with win7 ultimate and installation without any error. I am suspecting there is some error specific to this particular win7 ent machine.
The cmd I ran is with admin rights.
Possibly related: You have a 64-bit OS but are using a 32-bit Ruby. Try a 64-bit Ruby (and DevKit).
You might also try Ruby 2.2.2, which is explicitly tested on 64-bit Windows.
>gem install curb -- --with-curl-dir=C:/curl-7.43.0-win32/bin --with-curl-lib=C:/curl-7.43.0-win32/lib --with-curl-include=C:/curl-7.43.0-win32/include
I get the following error
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
C:/Ruby21-x64/bin/ruby.exe extconf.rb --with-curl-dir=C:/curl-7.43.0-win
32/bin --with-curl-lib=C:/curl-7.43.0-win32/lib --with-curl-include=C:/curl-7.43
.0-win32/include
checking for curl-config... no
checking for main() in -lcurl... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby21-x64/bin/ruby
--with-curl-dir
--with-curl-include=${curl-dir}/include
--with-curl-lib=${curl-dir}/lib
--with-curllib
--without-curllib
extconf.rb:18:in `<main>': Can't find libcurl or curl/curl.h (RuntimeError)
Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
options to extconf.
I have researched this for hours and tried installing several different curl versions, making sure the curl directory is in my path. Using both mingw32 and windows command line, the error persists.
Also tried:
gem install curb --platform=mswin32
UPDATE
Below is the mkmf.log from the curb directory. What is it trying to tell me?
find_executable: checking for curl-config... -------------------- no
--------------------
have_library: checking for main() in -lcurl... -------------------- no
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -IC:/curl-7.40.0-devel-mingw32/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -LC:/curl-7.40.0-devel-mingw32/bin -L. -lx64-msvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -IC:/curl-7.40.0-devel-mingw32/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -LC:/curl-7.40.0-devel-mingw32/bin -L. -lx64-msvcrt-ruby210 -lcurl -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
c:/ruby21-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/curl-7.40.0-devel-mingw32/bin/libcurl.dll when searching for -lcurl
c:/ruby21-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/curl-7.40.0-devel-mingw32/bin/libcurl.dll when searching for -lcurl
c:/ruby21-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcurl
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -IC:/curl-7.40.0-devel-mingw32/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -LC:/curl-7.40.0-devel-mingw32/bin -L. -lx64-msvcrt-ruby210 -lcurl -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: error: too few arguments to function 'main'
conftest.c:8:5: note: declared here
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { main(); return 0; }
/* end */
--------------------
Also, I have curl-config executable in my path.
With my setup (Win 8.1 64bit, ruby 2.16 64 bit), the following version of curl is required: curl-7.40.0-devel-mingw64
gem install curb -- --with-curl-lib=C:/curl-7.40.0-devel-mingw64/bin --with-curl-include=C:/curl-7.40.0-devel-mingw64/include
You also need the 64 bit ruby dev kit unzipped into your_ruby_directory/DevKit and the following or equivalent in youir path.
C:\Ruby21-x64\bin;C:\Ruby21-x64\DevKit\bin;C:\Ruby21-x64\DevKit\mingw\bin;C:\curl-7.40.0-devel-mingw64\bin;C:\Ruby21-x64\bin;C:\Ruby21-x64\DevKit\bin;C:\Ruby21-x64\DevKit\mingw\bin;
I had also ensured that the cygwin curl-config executable was in my path, though it is unclear if this was required.
I've been trying for a few days now to install the puma gem for ruby (2.1.5). I've update rubygems, I installed and succesfully ran the devkit, downloaded the latest ssl headers and fed them to the installation but all without success
This solution has been opted and I've seen several other ones from Luis Lavena or sourcing from http://rubygems.org instead of https:// but none of them seem to really work for me:
https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows
I keep getting this error:
$ gem install puma -v 2.9.2 -- --with-opt-dir=c:\openssl
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-opt-dir=c:openssl'
This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
c:/Ruby21-x64/bin/ruby.exe -r ./siteconf20150126-4428-1lhbkfi.rb extconf.rb
--with-opt-dir=c:openssl
checking for SSL_CTX_new() in -lssl... no
checking for SSL_CTX_new() in -lssleay32... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=c:/Ruby21-x64/bin/ruby
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-ssllib
--without-ssllib
--with-ssleay32lib
--without-ssleay32lib
extconf failed, exit code 1
Gem files will remain installed in c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/puma-2
.9.2 for inspection.
Results logged to c:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0
/puma-2.9.2/gem_make.out
my logfile:
have_library: checking for SSL_CTX_new() in -lssl... -------------------- no
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssl -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'SSL_CTX_new' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))SSL_CTX_new; return 0; }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssl -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'SSL_CTX_new' [-Wimplicit-function-declaration]
c:/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssl
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { SSL_CTX_new(); return 0; }
/* end */
--------------------
have_library: checking for SSL_CTX_new() in -lssleay32... -------------------- no
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssleay32 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'SSL_CTX_new' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))SSL_CTX_new; return 0; }
/* end */
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -Ic:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -Ic:/Ruby21-x64/include/ruby-2.1.0 -I. -Ic:openssl/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby21-x64/lib -Lc:openssl/lib -L. -lx64-msvcrt-ruby210 -lssleay32 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'SSL_CTX_new' [-Wimplicit-function-declaration]
c:/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssleay32
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5:
6: /*top*/
7: extern int t(void);
8: int main(int argc, char **argv)
9: {
10: if (argc > 1000000) {
11: printf("%p", &t);
12: }
13:
14: return 0;
15: }
16: int t(void) { SSL_CTX_new(); return 0; }
/* end */
--------------------
The gem_make.out file:
c:/Ruby21-x64/bin/ruby.exe -r ./siteconf20150126-4428-1lhbkfi.rb extconf.rb --with-opt-dir=c:openssl
checking for SSL_CTX_new() in -lssl... no
checking for SSL_CTX_new() in -lssleay32... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=c:/Ruby21-x64/bin/ruby
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-ssllib
--without-ssllib
--with-ssleay32lib
--without-ssleay32lib
extconf failed, exit code 1
Instructions you provided the link for are for 32 bit ruby (at least the link to openssl library has x86 in it), while it looks like you are using 64 bit version.
There is a way to check exact version of openssl used by your ruby installation as mentioned on Google Groups for RubyInstaller thread named Updated OpenSSL Knapsack packages (x86 and x64)
> ruby -v -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
ruby 2.1.5p273 (2014-11-13 revision 48405) [x64-mingw32]
OpenSSL 1.0.0o 15 Oct 2014
So in my case the way to go is https://bintray.com/oneclick/OpenKnapsack/openssl/view hoping that there is corresponding version.
I am unable to install ruby-opencv gem.
Here's what I have done so far.
Installed openCV with
sudo apt-get install libopencv-dev
Then tried installing ruby-opencv gem with
gem install ruby-opencv
But I got the following error
➜ test gem install ruby-opencv
Building native extensions. This could take a while...
ERROR: Error installing ruby-opencv:
ERROR: Failed to build gem native extension.
/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/bin/ruby extconf.rb
>> Check the required libraries...
checking for main() in -lopencv_calib3d... yes
checking for main() in -lopencv_contrib... yes
checking for main() in -lopencv_core... yes
checking for main() in -lopencv_features2d... yes
checking for main() in -lopencv_flann... yes
checking for main() in -lopencv_gpu... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/bin/ruby
--with-opencv-dir
--without-opencv-dir
--with-opencv-include
--without-opencv-include=${opencv-dir}/include
--with-opencv-lib
--without-opencv-lib=${opencv-dir}/lib
--with-libxml2-dir
--without-libxml2-dir
--with-libxml2-include
--without-libxml2-include=${libxml2-dir}/include
--with-libxml2-lib
--without-libxml2-lib=${libxml2-dir}/lib
--with-opencv_calib3dlib
--without-opencv_calib3dlib
--with-opencv_contriblib
--without-opencv_contriblib
--with-opencv_corelib
--without-opencv_corelib
--with-opencv_features2dlib
--without-opencv_features2dlib
--with-opencv_flannlib
--without-opencv_flannlib
--with-opencv_gpulib
--without-opencv_gpulib
extconf.rb:53:in `block in <main>': libopencv_gpu not found. (RuntimeError)
from extconf.rb:52:in `each'
from extconf.rb:52:in `<main>'
It seems there is no libopencv-gpu dependency installed.
I tried to install it with apt-get but couldn't succeed as no repository was found.
Can any one help me how to install ruby-opencv gem?
UPDATE
added mkmf.log content
➜ test cat /home/ckgagan/.rvm/gems/ruby-1.9.3-p484/gems/ruby-opencv-0.0.11/ext/opencv/mkmf.log
have_library: checking for main() in -lopencv_calib3d... -------------------- yes
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:53: error: ‘main’ undeclared (first use in this function)
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:4:28: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
have_library: checking for main() in -lopencv_contrib... -------------------- yes
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:53: error: ‘main’ undeclared (first use in this function)
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:4:28: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
have_library: checking for main() in -lopencv_core... -------------------- yes
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:53: error: ‘main’ undeclared (first use in this function)
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:4:28: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
have_library: checking for main() in -lopencv_features2d... -------------------- yes
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_core -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:53: error: ‘main’ undeclared (first use in this function)
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:4:28: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_core -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
have_library: checking for main() in -lopencv_flann... -------------------- yes
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:53: error: ‘main’ undeclared (first use in this function)
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:4:28: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
have_library: checking for main() in -lopencv_gpu... -------------------- no
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_gpu -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:53: error: ‘main’ undeclared (first use in this function)
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:4:28: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"gcc -o conftest -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-linux -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -I/usr/include -I/usr/local/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -Wl,-R/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -rdynamic -Wl,-export-dynamic -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d '-Wl,-rpath,/../lib' -Wl,-R -Wl,/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -L/home/ckgagan/.rvm/rubies/ruby-1.9.3-p484/lib -lruby -lopencv_gpu -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
/usr/bin/ld: cannot find -lopencv_gpu
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
Thanks
I just successfully install this gem ruby-opencv after hours investigation with many failures.
You have to download 2.x archive from http://opencv.org/downloads.html, NOTE, you can't install the latest version which is 3.0.beta, I'm the one who downloaded 3.0.beta initially, and got many failures.
Then install required packages and make install opencv according to this instruction
http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
From this installation instruction, you don't need to build opencv_contrib, just build opencv, that's all.
Finally, execute gem i ruby-opencv
Good luck.
Try installing the gem with the path to your opencv install as per the instructions on their github page.
gem install ruby-opencv -- --with-opencv-dir=/path/to/opencvdir
#lan Delairre, this is my note while installing opencv, hope this is helpful to you:
Download opencv-2.4.10 from http://opencv.org/downloads.html
Build libs
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
If got some error, try follow this instruction to install packages
http://milq.github.io/install-opencv-ubuntu-debian/
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libgtk2.0-dev
sudo apt-get install python-dev python-numpy
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev
cd ~/src/opencv-2.4.10
mkdir release
cd release
cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON ..
make -j7
sudo make install
sudo ldconfig