【发布时间】:2013-04-17 08:10:09
【问题描述】:
我面临堆损坏错误:我有一个 dll 和 TestAPP。
-
vector<Point> vInPts;// 测试应用程序 - 像下面这样转储输入vInPts.push_back(Point(730,405)); vInPts.push_back(Point(319,680)); vInPts.push_back(Point(292,757)); vInPts.push_back(Point(318,756)); vInPts.push_back(Point(726,736)); vInPts.push_back(Point(344,731)); vector<Point> vOutPts;-
调用 DLL -> 将相同的
vInPts向量复制到 DLL 中的vOutPts向量” -> 从该函数返回到 TestApp 时 -> 出现堆错误。现在面临堆错误
如何解决此堆错误?
提前谢谢!!!
【问题讨论】:
-
你是如何复制到输出向量中的?
-
@juanchopanza 我正在以正确的方式做事,我很确定复制不会成为我的问题。 “我测试了”,即使我只将输入向量传递给 dll 并且对输入向量什么都不做,并且当控件转到 TestAPP 时 - 出现相同的堆错误。
-
您使用的是哪个运行时?您是否为 dll 和应用程序使用相同的运行时?
-
@TobiasSchlegel 是的,两个运行时都相同。
-
@Pixel:请仔细检查命令行选项(例如,混合
/MD和/MDd可能会出现潜在错误)。还要考虑 StackOverflow 上的 this question 和 related answer。
标签: c++ dll stl heap-corruption