By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,846 Members | 1,857 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,846 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Jan 1 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.