> Please be kind to me.
 
-- There is no fear. All were newbies at some point in their careers, and all have made mistakes, met with failures and become experts.
 
This should work. It works for me. Perhaps, you shold check the return from BIO_new_fp like (if bio_out == NULL) return 1; - this will tell you if the root cause of failure is BIO_new_fp and not BIO_printf, as you may be mistakenly led to believe.
 
Alternatively, you can do the following: (and check for errors in all the functions returns)
 
 
BIO *bio_out;
bio_out = BIO_new(BIO_s_file());
 BIO_set_fp(bio_out, stdout, BIO_NOCLOSE)
     BIO_printf(bio_out, "Hello World\n");
 
One more point: return (0) works, but return 0 is more correct. return is not a function call, it is a statement.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Jiyong Xu
Sent: Friday, August 18, 2006 2:07 PM
To: openssl-users@openssl.org
Subject: Program exits without any error information

Hi,

I am a newbie to openssl. Maybe my questions here is silly. Please be kind to me.

I recently downloaded the openssl source, and compiled it under win32 successfully.

When I use VC6 to try to write a tiny test case, I just couldn't get through it.

My code is list below:

#include <stdio.h>
#include "openssl/bio.h"

int main ()
{
    BIO *bio_out;
    bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
    BIO_printf(bio_out, "Hello World\n");

    getchar();

    return(0);
}

The code was compiled successfully.

When the code went to "BIO_printf(bio_out, "Hello World\n");", it stoped and exited without any error information.

Could you tell me why? Does my program need further configurations?

DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.

Reply via email to