Cygwin なんでも掲示板

一覧最新記事過去一覧 | 検索FAQアンテナHOME
(新規投稿・発言はできません)


スレッド

└◇2377:
Cygwinでのsslエラーについて [tani] 08/05 23:50

 └◇2378:Re:Cygwinでのsslエラーについて [k] 08/06
  └◇2379:Re[2]:Cygwinでのsslエラーについて [tani] 08/06
   └◇2380:Re[3]:Cygwinでのsslエラーについて [n] 08/06
    └◇2381:Re[4]:Cygwinでのsslエラーについて [tani] 08/06 <


2377● Cygwinでのsslエラーについて[ tani ] 2004 08/05 23:50
始めまして、
早速質問で申し訳ないのですがgccでopensslコマンドを含んだ
コンパイル(リンク???)がどうしても通らないのですが、
何が原因で通らないのかどなたか教えて頂けないでしょうか?

環境
os windows2000
cygwin version 1.5.10-3
openssl version 0.9.7d-1
gcc version 3.3.1-3

エラー内容
$ gcc -o https.exe https.o
https.o(.text+0x273):https.c: undefined reference to `_SSL_load_error_strings'
https.o(.text+0x278):https.c: undefined reference to `_SSL_library_init'
https.o(.text+0x27d):https.c: undefined reference to `_SSLv23_client_method'
https.o(.text+0x285):https.c: undefined reference to `_SSL_CTX_new'
https.o(.text+0x29e):https.c: undefined reference to `_ERR_print_errors_fp'
https.o(.text+0x2b5):https.c: undefined reference to `_SSL_new'
https.o(.text+0x2ce):https.c: undefined reference to `_ERR_print_errors_fp'
https.o(.text+0x2ec):https.c: undefined reference to `_SSL_set_fd'
https.o(.text+0x305):https.c: undefined reference to `_ERR_print_errors_fp'
https.o(.text+0x316):https.c: undefined reference to `_RAND_poll'
https.o(.text+0x31b):https.c: undefined reference to `_RAND_status'
https.o(.text+0x37e):https.c: undefined reference to `_RAND_seed'
https.o(.text+0x38b):https.c: undefined reference to `_SSL_connect'
https.o(.text+0x3a4):https.c: undefined reference to `_ERR_print_errors_fp'
https.o(.text+0x401):https.c: undefined reference to `_SSL_write'
https.o(.text+0x41a):https.c: undefined reference to `_ERR_print_errors_fp'
https.o(.text+0x44f):https.c: undefined reference to `_SSL_read'
https.o(.text+0x4aa):https.c: undefined reference to `_ERR_print_errors_fp'
https.o(.text+0x4c1):https.c: undefined reference to `_SSL_shutdown'
https.o(.text+0x4da):https.c: undefined reference to `_ERR_print_errors_fp'
https.o(.text+0x4fc):https.c: undefined reference to `_SSL_free'
https.o(.text+0x507):https.c: undefined reference to `_SSL_CTX_free'
https.o(.text+0x50c):https.c: undefined reference to `_ERR_free_strings'
collect2: ld returned 1 exit status

一応opensslをソースからmakeしようとすると↓
Error makefile 1: Unknown preprocessor statement
と出てmake出来ませんでした。
スレッド一覧


2378● Re:Cygwinでのsslエラーについて[ k ] 2004 08/06 02:19
-sslがついてないからじゃないんですか?
スレッド一覧


2379● Re[2]:Cygwinでのsslエラーについて[ tani ] 2004 08/06 09:28
kさまご返答ありがとうございます。
無知をさらけ出す様で恥ずかしいのですが、
-sslオプションはリンク時に付ける物なのでしょうか?

$ gcc -ssl -o https.exe https.o
としてみても↓
gcc: unrecognized option `-ssl'
のエラーが出てしまいます。
スレッド一覧


2380● Re[3]:Cygwinでのsslエラーについて[ n ] 2004 08/06 11:12
-sslじゃなくて-lsslだとおもいます。

このあたりが参考になると思います。
http://www.google.co.jp/search?q=SSL_load_error_strings&hl=ja&lr=lang_ja&ie=UTF-8&oe=UTF-8&sourceid=mozilla-search
http://x68000.q-e-d.net/~68user/net/ssl-1.html
スレッド一覧


2381● Re[4]:Cygwinでのsslエラーについて[ tani ] 2004 08/06 11:41
nさまご返答ありがとうございます。

原因はライブラリーが足りなかったのですね…
$ gcc -o https.exe https.o -lssl -lcrypto
とオプションを付けたらリンクできました。

↓のHPとても参考になりました。
>http://x68000.q-e-d.net/~68user/net/ssl-1.html

kさま・nさま、
とても初歩的な質問にお答え頂きありがとうございました。
スレッド一覧

早田のホームページへ
CGIROOM