Re: [PythonCE] building a 'simple' example

2006-06-27 Thread Smit, M.C.
Giovanni Petrucciani wrote:
Smit, M.C. wrote:
 Hi

 The path is in sys.path. The DLL is next to the test programme that tries to 
 import it, it name is simple.dll, andthe error is raised on: import simple

 ImportError: DLL load failed:The specified module could not be found.
   
Just to catch a possible simple bug: did you rename the dll ?
I had problems when I was compiling sqlite, because I did build the dll
with a wrong name with EVC and then renamed it,
but dll have their name coded also inside and so it was not working.

   Giovanni

Hi Giovanni
Thanks for your hint but the dll was not renamed. (I did try changeing the 
extention to .pyd but that didn't help either)

cheers
___
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce


Re: [PythonCE] building a 'simple' example

2006-06-27 Thread Luke Dunstan

Hi,

I think the only way I could help further is if you posted a small but 
complete example that demonstrates the problem.

Luke

- Original Message - 
From: Smit, M.C. [EMAIL PROTECTED]
To: Luke Dunstan [EMAIL PROTECTED]; pythonce@python.org
Sent: Monday, June 26, 2006 3:40 PM
Subject: RE: [PythonCE] building a 'simple' example


Hi

The path is in sys.path. The DLL is next to the test programme that tries to 
import it, it name is simple.dll, andthe error is raised on: import simple

ImportError: DLL load failed:The specified module could not be found.

I'm running an winXP computer
and an Ipac PDA winMobile 2003

thanks for your thoughts



-Original Message-
From: [EMAIL PROTECTED] on behalf of Luke Dunstan
Sent: Fri 6/23/2006 6:04 PM
To: pythonce@python.org
Cc:
Subject: Re: [PythonCE] building a 'simple' example


Hi,

Where did you put the DLL? What is it called? What were the commands that
failed?

Luke

- Original Message - 
From: Smit, M.C. [EMAIL PROTECTED]
To: pythonce@python.org
Sent: Friday, June 23, 2006 11:21 PM
Subject: [PythonCE] building a 'simple' example


 Dear all

 While there have been some posts on this topic I don't believe the answer
 is in there jet.

 Eventually I want to write (with help of a colliegue whom is experienced
 in c) a module that can use a device. Some c libraries are available, and
 all I realy need is a function that returns an Int or String when called.

 I am trying to to build and run Listing 29-1 from the Python bible,
 but so far I have been unable to compile annything that will work.
 MS eVC is installed, and it compiles and links with no errors or warnings.
 but when I put the dll on the PDA, and run a test program all I get is an

 ImportError: DLL load failed:The specified module could not be found.

 it can clearly find the file couse it knows it is a dll. I'm hoplessly
 lost on what could be wrong, does annyone have any ideas.

 Cheers


 here is the code:
 // simple.cpp : Defines the entry point for the DLL application.
 //

 #include Python.h

 static PyObject *simple_add(PyObject *pSelf, PyObject *pArgs)
 {
 PyObject *pX, *pY;

 if (!PyArg_ParseTuple(pArgs, OO, pX, pY))
 return NULL;

 return PyNumber_Add(pX, pY);
 }

 static char count_doc[] = returns the number of arguments passed in;

 static PyObject *simple_count(PyObject *pSelf, PyObject *pArgs)
 {
 long count = PyTuple_Size(pArgs);
 return PyInt_FromLong(count);
 }

 static PyMethodDef simple_methods[] =
 {
 {add, simple_add, METH_VARARGS, NULL},
 {count, simple_count, METH_VARARGS, count_doc},
 {NULL, NULL}
 };

 DL_EXPORT(void) initsimple()
 {
 Py_InitModule(simple, simple_methods);
 }
___
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce



___
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce


Re: [PythonCE] building a 'simple' example

2006-06-26 Thread Smit, M.C.
Hi

The path is in sys.path. The DLL is next to the test programme that tries to 
import it, it name is simple.dll, andthe error is raised on: import simple

ImportError: DLL load failed:The specified module could not be found.

I'm running an winXP computer 
and an Ipac PDA winMobile 2003

thanks for your thoughts



-Original Message-
From:   [EMAIL PROTECTED] on behalf of Luke Dunstan
Sent:   Fri 6/23/2006 6:04 PM
To: pythonce@python.org
Cc: 
Subject:Re: [PythonCE] building a 'simple' example


Hi,

Where did you put the DLL? What is it called? What were the commands that 
failed?

Luke

- Original Message - 
From: Smit, M.C. [EMAIL PROTECTED]
To: pythonce@python.org
Sent: Friday, June 23, 2006 11:21 PM
Subject: [PythonCE] building a 'simple' example


 Dear all

 While there have been some posts on this topic I don't believe the answer 
 is in there jet.

 Eventually I want to write (with help of a colliegue whom is experienced 
 in c) a module that can use a device. Some c libraries are available, and 
 all I realy need is a function that returns an Int or String when called.

 I am trying to to build and run Listing 29-1 from the Python bible,
 but so far I have been unable to compile annything that will work.
 MS eVC is installed, and it compiles and links with no errors or warnings.
 but when I put the dll on the PDA, and run a test program all I get is an

 ImportError: DLL load failed:The specified module could not be found.

 it can clearly find the file couse it knows it is a dll. I'm hoplessly 
 lost on what could be wrong, does annyone have any ideas.

 Cheers


 here is the code:
 // simple.cpp : Defines the entry point for the DLL application.
 //

 #include Python.h

 static PyObject *simple_add(PyObject *pSelf, PyObject *pArgs)
 {
 PyObject *pX, *pY;

 if (!PyArg_ParseTuple(pArgs, OO, pX, pY))
 return NULL;

 return PyNumber_Add(pX, pY);
 }

 static char count_doc[] = returns the number of arguments passed in;

 static PyObject *simple_count(PyObject *pSelf, PyObject *pArgs)
 {
 long count = PyTuple_Size(pArgs);
 return PyInt_FromLong(count);
 }

 static PyMethodDef simple_methods[] =
 {
 {add, simple_add, METH_VARARGS, NULL},
 {count, simple_count, METH_VARARGS, count_doc},
 {NULL, NULL}
 };

 DL_EXPORT(void) initsimple()
 {
 Py_InitModule(simple, simple_methods);
 }
___
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce



___
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce


[PythonCE] building a 'simple' example

2006-06-23 Thread Smit, M.C.
Dear all

While there have been some posts on this topic I don't believe the answer is in 
there jet.

Eventually I want to write (with help of a colliegue whom is experienced in c) 
a module that can use a device. Some c libraries are available, and all I realy 
need is a function that returns an Int or String when called.

I am trying to to build and run Listing 29-1 from the Python bible,
but so far I have been unable to compile annything that will work. 
MS eVC is installed, and it compiles and links with no errors or warnings.
but when I put the dll on the PDA, and run a test program all I get is an 

ImportError: DLL load failed:The specified module could not be found.

it can clearly find the file couse it knows it is a dll. I'm hoplessly lost on 
what could be wrong, does annyone have any ideas.

Cheers


here is the code:
// simple.cpp : Defines the entry point for the DLL application.
//

#include Python.h

static PyObject *simple_add(PyObject *pSelf, PyObject *pArgs)
{
PyObject *pX, *pY;

if (!PyArg_ParseTuple(pArgs, OO, pX, pY))
return NULL;

return PyNumber_Add(pX, pY);
}

static char count_doc[] = returns the number of arguments passed in;

static PyObject *simple_count(PyObject *pSelf, PyObject *pArgs)
{
long count = PyTuple_Size(pArgs);
return PyInt_FromLong(count);
}

static PyMethodDef simple_methods[] =
{
{add, simple_add, METH_VARARGS, NULL},
{count, simple_count, METH_VARARGS, count_doc},
{NULL, NULL}
};

DL_EXPORT(void) initsimple()
{
Py_InitModule(simple, simple_methods);
}





___
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce


Re: [PythonCE] building a 'simple' example

2006-06-23 Thread Luke Dunstan

Hi,

Where did you put the DLL? What is it called? What were the commands that 
failed?

Luke

- Original Message - 
From: Smit, M.C. [EMAIL PROTECTED]
To: pythonce@python.org
Sent: Friday, June 23, 2006 11:21 PM
Subject: [PythonCE] building a 'simple' example


 Dear all

 While there have been some posts on this topic I don't believe the answer 
 is in there jet.

 Eventually I want to write (with help of a colliegue whom is experienced 
 in c) a module that can use a device. Some c libraries are available, and 
 all I realy need is a function that returns an Int or String when called.

 I am trying to to build and run Listing 29-1 from the Python bible,
 but so far I have been unable to compile annything that will work.
 MS eVC is installed, and it compiles and links with no errors or warnings.
 but when I put the dll on the PDA, and run a test program all I get is an

 ImportError: DLL load failed:The specified module could not be found.

 it can clearly find the file couse it knows it is a dll. I'm hoplessly 
 lost on what could be wrong, does annyone have any ideas.

 Cheers


 here is the code:
 // simple.cpp : Defines the entry point for the DLL application.
 //

 #include Python.h

 static PyObject *simple_add(PyObject *pSelf, PyObject *pArgs)
 {
 PyObject *pX, *pY;

 if (!PyArg_ParseTuple(pArgs, OO, pX, pY))
 return NULL;

 return PyNumber_Add(pX, pY);
 }

 static char count_doc[] = returns the number of arguments passed in;

 static PyObject *simple_count(PyObject *pSelf, PyObject *pArgs)
 {
 long count = PyTuple_Size(pArgs);
 return PyInt_FromLong(count);
 }

 static PyMethodDef simple_methods[] =
 {
 {add, simple_add, METH_VARARGS, NULL},
 {count, simple_count, METH_VARARGS, count_doc},
 {NULL, NULL}
 };

 DL_EXPORT(void) initsimple()
 {
 Py_InitModule(simple, simple_methods);
 }
___
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce