1

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を実行すると、
エラーがいっぱい出てコンパイルできません。

テスト用コード:

#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);
}

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

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

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

1 件の回答 1

0

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を組み合わせるのは敷居が高く、本来の問題に加えて組み合わせ問題が発生しますので、まずはどちらか一方の環境だけで試すことをお勧めします。

3
  • BufferOverflowU.libはどこで入手できますか? BufferOverflowU.libを入手するためにWDK10をインストールしたんですが、関係ありそうなフォルダを探してもBufferOverflowU.libが見つかりませんでした。(armフォルダにはありました) インストールしたWDKは、Windows Driver Kit - Windows 10.0.26639です。
    – uln
    Commented 2015年11月20日 14:51
  • @uln 加筆しました。確認願います。
    – sayuri
    Commented 2015年11月21日 4:23
  • 同じ場所にBufferOverflowU.libファイルはありました。BufferOverflowU.libをリンクすると全部コピーできるくらいエラーが減ったんですが、一度諦めてvisual studioの使い方を調べなおしてから再挑戦しようと思います。ありがとうございました。
    – uln
    Commented 2015年11月21日 12:20

この質問に回答するには、ログインする必要があります。

求めていた回答ではありませんか? のタグが付いた他の質問を参照する。