Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual c++ 从MinGW的MSVC DLL调用函数_Visual C++_Opencv_Dll_Mingw - Fatal编程技术网

Visual c++ 从MinGW的MSVC DLL调用函数

Visual c++ 从MinGW的MSVC DLL调用函数,visual-c++,opencv,dll,mingw,Visual C++,Opencv,Dll,Mingw,我正在尝试将一个DLL(使用MSVC编译)与MinGW编译器一起使用。dll和二进制文件都使用opencv dll,并使用相应的编译器编译(MSVC用于MSVC dll,MinGW用于MinGW二进制文件)。但是,opencv vesrion与2.42相同 我可以成功加载我的DLL(使用extern C),但从DLL调用SetRect函数会导致以下控制台输出: Set search rect(qt): 162, 119, 50, 50 (Internal error: pc 0x112 in r

我正在尝试将一个DLL(使用MSVC编译)与MinGW编译器一起使用。dll和二进制文件都使用opencv dll,并使用相应的编译器编译(MSVC用于MSVC dll,MinGW用于MinGW二进制文件)。但是,opencv vesrion与2.42相同

我可以成功加载我的DLL(使用extern C),但从DLL调用SetRect函数会导致以下控制台输出:

Set search rect(qt): 162, 119, 50, 50
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
Set search rect(dll): 2282800, 2282908, 2282840, 1874777202
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
(Internal error: pc 0x112 in read in psymtab, but not in symtab.)
为什么数字不同,内部错误是什么,如何解决

在一些代码中,请注意Rect类来自Opencv

MinGW二进制文件:

std::cout << "Rect(qt): " << rect.x << ", " << rect.y << ", " << rect.width << ", " << rect.height << "\n" << std::flush;
SetRect(rect);

std::cout除非您提供详细信息,否则我们将无法重现您的问题

我建议您仔细研究MinGW常见问题,特别是它涵盖的部分

void SetRect(Rect rect)
{
    std::cout << ""Rect(dll): " << rect.x << ", " << rect.y << ", " << rect.width << ", " << rect.height << "\n" << std::flush;
}