Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ImportError: DLL load failed

Reply
Thread Tools

ImportError: DLL load failed

 
 
Ajay
Guest
Posts: n/a
 
      09-26-2004
hi!

I wrote a simple C code to work with OpenSSL and it builds fine.
however when i import it, i get an error
ImportError: DLL load failed. The specified module could not be found.

the file is in Python/Lib directory.

the code is below.

thanks

#include <Python.h>
#include "openssl/bio.h"
#include "openssl/ssl.h"
#include "openssl/err.h"

static PyObject * start(PyObject *self, PyObject *args)
{
int x;
BIO * bio;
char buf[1024];
int len = 512;
SSL_load_error_strings();
ERR_load_BIO_strings();
OpenSSL_add_all_algorithms();
bio = BIO_new_connect("www.ibm.com:80");
if(bio==NULL)
{
//handle error
x = -5;
}
if(BIO_do_connect(bio) <= 0)
{
//handle failed connection
x = -4;
}
x = BIO_read(bio, buf, len);
if(x == 0)
{
//handle closed connection
x = -3;
}
else if(x<0)
{
if(! BIO_should_retry(bio))
{
//handle failed read
x = -2;
}
//do something to handle the retry
}
return Py_BuildValue("i", x);
}

static PyMethodDef testSSLMethods[] = {
{"start", start, METH_VARARGS, "start and test SSL."},
{NULL, NULL, 0, NULL}
};

PyMODINIT_FUNC
inittestSSL(void)
{
(void) Py_InitModule("testSSL", testSSLMethods);
}





----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does one get from "ImportError: DLL load failed:..." to a culprit.dll and symbol? Chris Cormie Python 11 02-24-2009 08:00 AM
Errors: Failed to load viewstate. & Validation of viewstate MAC failed. sck10 ASP .Net 6 09-01-2006 05:59 PM
DLL load failed: The specified procedure could not be found Bill Davy Python 2 06-01-2005 09:40 AM
cx_Oracle failed to load DLL BUT versions correct jmdeschamps Python 1 02-09-2005 03:55 PM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments