QA@IT

Windows10にSQLite3をinstallしようとすると失敗

493 PV

Windows10にSQLite3をinstallしようとすると以下のエラーが発生しました。

C:\Ruby25-x64>gem install sqlite3
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-x86_64-sqlite3
警告: mingw-w64-x86_64-sqlite3-3.27.2-2 は最新です -- スキップ
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.0/ext/sqlite3

C:/Ruby25-x64/bin/ruby.exe -I C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190324-10956-qeapqo.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... no
checking for dlopen()... no
missing function dlopen
*** 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:/Ruby25-x64/bin/$(RUBY_BASE_NAME)
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--with-pthreadlib
--without-pthreadlib
--with-dllib
--without-dllib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/sqlite3-1.4.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.0 for inspection.
Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/sqlite3-1.4.0/gem_make.out

なお、mkmf.logの内容は以下です。

"pkg-config --exists sqlite3"
| pkg-config --libs sqlite3
=> "-LC:/Ruby25-x64/msys64/mingw64/lib -lsqlite3\n"
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby25-x64/lib -L. -pipe -s -lx64-msvcrt-ruby250 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/
end */

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby25-x64/lib -L. -pipe -s -lx64-msvcrt-ruby250 -LC:/Ruby25-x64/msys64/mingw64/lib -lsqlite3 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/
end */

| pkg-config --cflags-only-I sqlite3
=> "-IC:/Ruby25-x64/msys64/mingw64/include\n"
| pkg-config --cflags-only-other sqlite3
=> "\n"
| pkg-config --libs-only-l sqlite3
=> "-lsqlite3\n"
package configuration for sqlite3
cflags:
ldflags: -LC:/Ruby25-x64/msys64/mingw64/lib
libs: -lsqlite3

find_header: checking for sqlite3.h... -------------------- yes

"x86_64-w64-mingw32-gcc -E -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -IC:/Ruby25-x64/msys64/mingw64/include -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -o conftest.i"
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
5: #include
/
end */


find_library: checking for pthread_create() in -lpthread... -------------------- yes

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -IC:/Ruby25-x64/msys64/mingw64/include -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby25-x64/lib -L. -pipe -s -LC:/Ruby25-x64/msys64/mingw64/lib -lsqlite3 -lx64-msvcrt-ruby250 -lpthread -lsqlite3 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'pthread_create' undeclared (first use in this function); did you mean 'rb_thread_create'?
int t(void) { void ((volatile p)()); p = (void (()()))pthread_create; return !p; }
^~~~~~~~~~~~~~
rb_thread_create
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
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 ((
)()))pthread_create; return !p; }
/* end */

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -IC:/Ruby25-x64/msys64/mingw64/include -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby25-x64/lib -L. -pipe -s -LC:/Ruby25-x64/msys64/mingw64/lib -lsqlite3 -lx64-msvcrt-ruby250 -lpthread -lsqlite3 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
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: extern void pthread_create();
17: int t(void) { pthread_create(); return 0; }
/
end */


have_library: checking for -ldl... -------------------- no

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -IC:/Ruby25-x64/msys64/mingw64/include -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby25-x64/lib -L. -pipe -s -LC:/Ruby25-x64/msys64/mingw64/lib -lpthread -lsqlite3 -lx64-msvcrt-ruby250 -ldl -lpthread -lsqlite3 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
C:/Ruby25-x64/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldl
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
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:
17: int t(void) { ; return 0; }
/
end */


have_func: checking for dlopen()... -------------------- no

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -IC:/Ruby25-x64/msys64/mingw64/include -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby25-x64/lib -L. -pipe -s -LC:/Ruby25-x64/msys64/mingw64/lib -lpthread -lsqlite3 -lx64-msvcrt-ruby250 -lpthread -lsqlite3 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
conftest.c: In function 't':
conftest.c:16:57: error: 'dlopen' undeclared (first use in this function); did you mean '_lopen'?
int t(void) { void ((volatile p)()); p = (void (()()))dlopen; return !p; }
^~~~~~
_lopen
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
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 ((
)()))dlopen; return !p; }
/* end */

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby25-x64/include/ruby-2.5.0/x64-mingw32 -IC:/Ruby25-x64/include/ruby-2.5.0/ruby/backward -IC:/Ruby25-x64/include/ruby-2.5.0 -I. -IC:/Ruby25-x64/msys64/mingw64/include -D_FORTIFY_SOURCE=2 -D_USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -march=x86-64 -mtune=generic -O2 -pipe conftest.c -L. -LC:/Ruby25-x64/lib -L. -pipe -s -LC:/Ruby25-x64/msys64/mingw64/lib -lpthread -lsqlite3 -lx64-msvcrt-ruby250 -lpthread -lsqlite3 -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
C:\Users\cycle\AppData\Local\Temp\cc9K72Fj.o:conftest.c:(.text+0x5): undefined reference to `dlopen'
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include
4: #include
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: extern void dlopen();
17: int t(void) { dlopen(); return 0; }
/
end */


どうすれば解決できるでしょうか?
ご回答お願い致します。

ウォッチ

この質問への回答やコメントをメールでお知らせします。