问题解决了。函数名重复。
是的。你知道吗
此代码在exe中工作,但在使用python时不在dll中工作。你知道吗
当程序运行到dec(&buffer2, &length, &buffer);
时,Python抛出此错误。你知道吗
python和dll都是x64。你知道吗
#include "Decompress.h"
#pragma comment (lib,"Decompress.lib")
#define DLLEXPORT extern "C" __declspec(dllexport)
DLLEXPORT void try_dec()
{
int buffer[20];
int buffer2[20];
int length = 20;
dec(&buffer2, &length, &buffer);
return;
}
import ctypes
dll = ctypes.CDLL('Dec.dll')
dll.try_dec()
dll.dec()
OSError: exception: stack overflow
该函数将调用自身,最终进入无限循环,导致堆栈溢出。 为了防止这种错误,您应该将函数签名更改为
相关问题 更多 >
编程相关推荐