Ask Your Question

chabana's profile - activity

2013-07-13 12:11:57 -0600 asked a question Use DLL Visual Studio 2010 with C#

My objectif is to generate a dll in C for use later in a prjet C #. I followed the tuttoriel on the following link: http://nico-pyright.developpez.com/t...c2005/interop/

In the project that generates the C DLL I use the OpenCV library and here is the configuration of my project to generate the DLL C: C / C -> Code Generation -> Runtime Library = Multi-threaded DLL (/ MD) Linker -> Advanced -> Computer MachineX64 target = (/ MACHINE: X64) Properties -> Configuration Properties -> VC Directories -> Include Directories: C: \ OpenCV \ opencv \ build \ include C: \ OpenCV \ opencv \ modules \ core \ include \ opencv2 \ core C: \ OpenCV \ opencv \ include \ opencv2 C: \ OpenCV \ opencv \ include \ opencv Properties -> Configuration Properties -> VC Directories -> Library directories: C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ lib C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ bin Properties -> Configuration Properties -> VC Directories -> Directories sources: C: \ OpenCV \ opencv \ modules Properties -> Configuration Properties -> öditeur links -> Input -> Additional Dependencies: C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ lib \ opencv_core240d.lib C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ lib \ opencv_video240d.lib C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ lib \ opencv_ml240d.lib C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ lib \ opencv_legacy240d.lib C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ lib \ opencv_imgproc240d.lib C: \ OpenCV \ opencv \ build \ x64 \ vc10 \ lib \ opencv_highgui240d.lib

Generating the DLL goes well and it is intended for a 64-bit system.

Here is the configuration of my C # project: Properties -> Build -> Platform = (x86) active Properties -> Build -> General -> Platform target = x64

Then I generate the DLL in the directory with the executable C # and running I get an error that you find in the attached picture: image description

Usually this error is a conflict between 32-bit and 64-bit, but I do not see how to correct it! someone has an idea how to correct it?

Knowing that the OpenCV configuration is a priori made ​​for an x64 system and when I am not using OpenCV in the DLL generate use in C # works. So I guess the error is OpenCV side but I do not see or?

Thank you.