BOOST again: how to proceed from here....

O

Osiris

I'm trying to work with Boost, trying to use my C-code from Python..
So now I have generated a C_test2.dll and a C_test2.lib with Visual
C++ 2005, from code like this:
===============
#include <stdlib.h>
#include <stdafx.h>

namespace { // Avoid cluttering the global namespace.

int my_int; /* a global integer: or outside namespace ? */
double calc ( double f)
{
my_int = (int) (f/2);
// printf( "Half of %f is %d\n", f, my_int );
return f/2;
}

}

#include <boost/python.hpp>

using namespace boost::python;

BOOST_PYTHON_MODULE( half )
{
def("calc", calc );
}
=====================

Now I want to use calc from Python.
I have my Python in c:\python24\ (IDLE system, version 2.4.4)
Where do I put the dll and lib ?

in c:\python24\libs and c:\python24\DLLs ?

and do I import like:
import C_test2.dll
?
because now I get this:

Traceback (most recent call last):
File "<pyshell#1>", line 1, in -toplevel-
import C_test2.dll
ImportError: DLL load failed: The specified module could not be found.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top