Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Can';t在windows xp上编译rsa.h_C++_Windows_Openssl_Rsa_Codeblocks - Fatal编程技术网

C++ Can';t在windows xp上编译rsa.h

C++ Can';t在windows xp上编译rsa.h,c++,windows,openssl,rsa,codeblocks,C++,Windows,Openssl,Rsa,Codeblocks,我遇到了openssl的惊喜。我已经在我的windows XP上安装了openssl libs,并尝试在C++上编译简单的示例: #include <openssl\rsa.h> #include <stdio.h> int main(int argc, char** argv) { RSA* rsa; unsigned char* input_string; unsigned char* encrypt_string; unsigned

我遇到了openssl的惊喜。我已经在我的windows XP上安装了openssl libs,并尝试在C++上编译简单的示例:

#include <openssl\rsa.h>
#include <stdio.h>
int main(int argc, char** argv)
{
    RSA* rsa;
    unsigned char* input_string;
    unsigned char* encrypt_string;
    unsigned char* decrypt_string;

    if ( RSA_generate_key_ex( rsa, 1024, NULL, NULL) ) {
        printf( " I'm using RSA lib!\n" ) ;
    } ;

    return 0;
}

我用的是代码块,谷歌帮不了我。我很难过。你能帮我吗?

你必须告诉编译器链接openssl库


在代码块中,您的项目设置中肯定有一个选项卡库(或类似的东西),您可以在其中添加openssl库

我猜你没有链接到你需要链接的库。它编译得很好。我在链接器设置中添加了MinGW的libs,现在它可以工作了!非常感谢!不客气。如果答案解决了您的问题,不要忘记将答案设置为已接受。
C:\Programming\C++_Projects\main.o:main.cpp|| undefined reference to `RSA_generate_key_ex'|
||=== Build finished: 1 errors, 0 warnings ===|