Hi, dgarske,
I follow your advice to correct my code,but sorry,it dos'nt work.
I made a simple test.
the original ssl-tutorial-2.2 works very well.no problem during compiling and running.
but, if i add some code lines in the tcpcli01.c,the compiler allways reports some errors.
#include "unp.h"
#include <wolfssl/options.h>
#include <wolfssl/ssl.h>
int main(int argc, char **argv)
{
....
if( (ssl = wolfSSL_new(ctx)) == NULL) {
fprintf(stderr, "wolfSSL_new error.\n");
exit(EXIT_FAILURE);
}
#if 1
{//added test code
WOLFSSL_BIO *mRbio = wolfSSL_BIO_new(wolfSSL_BIO_s_mem());
WOLFSSL_BIO *mWbio = wolfSSL_BIO_new(wolfSSL_BIO_s_mem());
wolfSSL_set_bio(ssl, mRbio, mWbio);
}
#endif
wolfSSL_set_fd(ssl, sockfd);
str_cli(stdin, ssl); /* do it all */
...
}
after make,it says:
qn@Hisino-Linux-srv:~/smb/tls/wolfssl/ssl-tutorial-2.2/finished_src/echoclient$ make
gcc -Wall -o echoclient ../lib/*.c tcpcli01.c -I ../include -lm -lwolfssl
In file included from /usr/local/include/wolfssl/ssl.h:33:0,
from tcpcli01.c:2:
/usr/local/include/wolfssl/wolfcrypt/settings.h:2138:14: warning: #warning "For timing resistance / side-channel attack prevention consider using harden options" [-Wcpp]
#warning "For timing resistance / side-channel attack prevention consider using harden options"
^
qn@Hisino-Linux-srv:~/smb/tls/wolfssl/ssl-tutorial-2.2/finished_src/echoclient$ make
gcc -Wall -o echoclient ../lib/*.c tcpcli01.c -I ../include -lm -lwolfssl
/tmp/cc3crctr.o: In function `main':
tcpcli01.c:(.text+0x2cf): undefined reference to `wolfSSL_BIO_s_mem'
tcpcli01.c:(.text+0x2d7): undefined reference to `wolfSSL_BIO_new'
tcpcli01.c:(.text+0x2e0): undefined reference to `wolfSSL_BIO_s_mem'
tcpcli01.c:(.text+0x2e8): undefined reference to `wolfSSL_BIO_new'
tcpcli01.c:(.text+0x303): undefined reference to `wolfSSL_set_bio'
collect2: error: ld returned 1 exit status
make: *** [echoclient] Error 1
qn@Hisino-Linux-srv:~/smb/tls/wolfssl/ssl-tutorial-2.2/finished_src/echoclient$
pls give more advice.
thank you