19073


perlをインストールして、  
Visual Studio Community 2015をインストールして、  
開発者コマンドプロンプトfor VS2015から、

cd openssl-1.0.2d  
perl Configure VC-WIN32 --prefix=C:\openssl-1.0.2d-x86 no-asm  
ms\do_ms  
nmake -f ms\nt.mak  
nmake -f ms\nt.mak install

を実行すると実行ファイルやヘッダファイル、LIBファイル等が生成されたので、  
C_INCLUDE_PATHにC:\openssl-1.0.2d-x86\includeを追加して、  
LIBRARY_PATHにC:\openssl-1.0.2d-x86\libを追加して、

gcc test.c -l ssleay32 -l libeay32を実行すると、  
エラーがいっぱい出てコンパイルできません。

テスト用コード:

[code]

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <openssl/md5.h>
    
    void main()
    {
        MD5_CTX c;
        char *data = "hoge";
        unsigned char md[MD5_DIGEST_LENGTH];
        char mdString[33];
        int r, i;
    
        r = MD5_Init(&c);
        if(r != 1) {
            perror("init");
            exit(1);
        }
    
        r = MD5_Update(&c, data, strlen(data));
        if(r != 1) {
            perror("update");
            exit(1);
        }
    
        r = MD5_Final(md, &c);
        if(r != 1) {
            perror("final");
            exit(1);
        }
    
        for(i = 0; i < 16; i++)
             sprintf(&mdString[i * 2], "%02x", (unsigned int)md[i]);
    
        printf("md5 digest: %s\n", mdString);
    }
    
[/code]

多すぎて切れてしまってるのですが、コピーできる範囲だとこんな感じです。

> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/wrap128.obj):(.text$mn+0x12c):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/wrap128.obj):(.text$mn+0x13f):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/xts128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/xts128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/xts128.obj):(.text$mn+0x3e):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/xts128.obj):(.text$mn+0x21a):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/xts128.obj):(.text$mn+0x339):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xa3):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x21d):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xa4):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x1b3):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xa2):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xda):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x2f6):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xb4):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0xec):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ccm128.obj):(.text$mn+0x2a8):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gcm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gcm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gcm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gcm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gcm128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gcm128.obj):(.text$mn+0x6):
> undefined references to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0x192):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0x92):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0x1f6):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb128.obj):(.text$mn+0x28b):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ctr128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ctr128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cbc128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cbc128.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cbc128.obj):(.text$mn+0x26a):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cbc128.obj):(.text$mn+0x29c):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cbc128.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/aes_core.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/aes_core.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/des_enc.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/des_enc.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ofb64ede.obj):(.text$mn+0x6):
> undefined references to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ofb64ede.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ofb64ede.obj):(.text$mn+0x1d5):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ofb64ede.obj):(.text$mn+0x1eb):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb64ede.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb64ede.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb64ede.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/cfb64ede.obj):(.text$mn+0x752):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ecb3_enc.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/sha1_one.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/sha1_one.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/sha1_one.obj):(.text$mn+0x43):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/sha1_one.obj):(.text$mn+0x82):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0x206):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0x78):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/gost_keywrap.obj):(.text$mn+0x7e):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x41):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x96):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x131):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0xb6):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0xd5):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0xf4):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x176):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x1cd):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_lib.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_crpt.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_crpt.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_crpt.obj):(.text$mn+0x95):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_crpt.obj):(.text$mn+0x11e):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_crpt.obj):(.text$mn+0x1b0):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_crpt.obj):(.text$mn+0x1db):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/pk7_attr.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_def.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_def.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_def.obj):(.text$mn+0x4db):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_def.obj):(.text$mn+0x5a7):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_def.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_api.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_api.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/conf_api.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/pcy_map.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_pbe.obj):(.text$mn+0x6):
> undefined references to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt2.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt2.obj):(.text$mn+0xc1):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt2.obj):(.text$mn+0x32e):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt2.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt2.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt2.obj):(.text$mn+0x201):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt.obj):(.text$mn+0xbc):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt.obj):(.text$mn+0x1aa):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p5_crpt.obj):(.text$mn+0x331):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ecs_ossl.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ecs_ossl.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ecs_ossl.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ech_ossl.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ec2_mult.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ec2_mult.obj):(.text$mn+0x6):
> undefined references to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0x71):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0xc5):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0x18c):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0x5f):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0x150):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/dso_win32.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x3a):
> undefined reference to `__acrt_iob_func'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x64):
> undefined reference to `__acrt_iob_func'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x3):
> undefined reference to `__acrt_iob_func'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x20):
> undefined reference to `__acrt_iob_func'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x148):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x54):
> undefined reference to `@__security_check_cookie@4'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/ui_openssl.obj):(.text$mn+0x66):
> undefined reference to `@__security_check_cookie@4'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_key.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_key.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_decr.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_decr.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_decr.obj):(.text$mn+0x6):
> undefined reference to `_chkstk'  
>  C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_decr.obj):(.text$mn+0xb):
> undefined reference to `__security_cookie'  
>
> C:/openssl-1.0.2d-x86/lib/libeay32.lib(tmp32/p12_decr.obj):(.text$mn+0x184):
> undefined reference to `@__security_check_cookie@4'  
>  collect2.exe: error: ld returned 1 exit status

ライブラリのコンパイルからネットの情報を見て試しただけなので、どこからおかしいのかわからないんですが、どうすればいいと思いますか？


CC BY-SA 3.0
2015-11-20T05:57:36.953
19072
2015-11-21T04:23:25.437
2015-11-20T06:27:16.890
4236
13313
question
c windows openssl
Windows7のMinGW(GCC)を使ってOpenSSLライブラリを使う方法がわかりません


> undefined reference to@__security_check_cookie@4

に対処するには `BufferOverflowU.lib` もリンクに追加する必要があります。

試していませんが`BufferOverflowU.lib`はライブラリの標準検索パスに含まれているはずで、パス指定せずライブラリ名だけで済むと思います。具体的な場所としては手元の環境ではVisual
Studio付属のWindows SDK（ソフトウェア開発キット）で`C:\Program Files (x86)\Windows
Kits\8.1\Lib\winv6.3\um\x86` にありました。

なお、WDKはドライバー開発キットですので、通常のアプリケーション開発には関係ありません。

* * *

Windows環境における標準的な開発環境となっているVisual
Studioと、非標準のGCCを組み合わせるのは敷居が高く、本来の問題に加えて組み合わせ問題が発生しますので、まずはどちらか一方の環境だけで試すことをお勧めします。


CC BY-SA 3.0
2015-11-20T06:19:01.177
19073
2015-11-21T04:23:25.437
2015-11-21T04:23:25.437
4236
4236
19072
answer