Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a Python wrapper for a C++ Dll, which I've compiled with Boost-Python, resulting in my_wrapper.pyd. From native python (Python 24) interpreter, I'm able to import this module using

import sys
sys.path.append(<PATH TO MY_WRAPPER.PYD>)
import my_wrapper
my_wrapper.func1() # Able to call this func1

If I try to import the same .pyd, from under ipy (IronPython prompt), after setting sys.path appropriately, I am getting the following error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named my_wrapper

Am I missing something? or is this entirely not possible? I came across some information about IronClad , but couldn't succeed either. In that PATH_TO_MY_WRAPPER, I also have another dll (compiled with VS2008, /clr option. The basic purpose of this other dll is to allow C# application to interact with native C++ (Managed-to-Unmanaged).

If I try to import this second .dll, from under ipy (IronPython prompt), after setting sys.path appropriately, I am still getting the following error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named my_wrapper

I was under the impression that atleast secod dll could be imported. Am I missing something?

From C# code, i'm able to load the C++/CLI compiled dll using the following

protected virtual Assembly LoadAssembly(string path)
    {
        //return Assembly.LoadFile(path);
         return Assembly.LoadFrom(path);
    }

path here is the path to my installed directory, where i have this dll present.

When i try to do the following:

import clr
clr.AddReferenceToFileAndPath(path)

IronPython crashes!

share|improve this question
    
Crash Message: IronPython has stopped working. Standard dialog box –  code82 Aug 29 '13 at 5:44
    
And the dll is not 64 bit, it's 32 bit :) –  code82 Aug 29 '13 at 5:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.