尝试在 C 中使用 cvCreateHist 时检测到 glibc
这是我代码的一部分
int histsize=16;
float range=[0,255];
float* ranges[] = { range };
bool uniform=true;
CvHistogram* hist = cvCreateHist(1, &histsize, CV_HIST_ARRAY, ranges, uniform);
但是当我尝试执行 cvCreateHist 时,程序终止并抛出错误 * glibc 检测到 malloc(): 内存损坏: 0x083109b8 **
我正在 eclipse、Ubuntu 中工作。请帮助我。
This is a part of my code
int histsize=16;
float range=[0,255];
float* ranges[] = { range };
bool uniform=true;
CvHistogram* hist = cvCreateHist(1, &histsize, CV_HIST_ARRAY, ranges, uniform);
But when I try to execute cvCreateHist the program terminates and throws an error saying
* glibc detected malloc(): memory corruption: 0x083109b8 **
I am working in eclipse,Ubuntu.Please help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实是,由于以下几行,您的代码甚至不应该编译:
在回答这个问题之前,我必须说我认为您可以从这篇文章中受益匪浅:写出完美的问题
我不知道你在说什么正在尝试完全使用该代码,但以下编译 &不崩溃:
The truth is that your code shouldn't even compile because of these lines:
Before answering this question, I must say that I think you can benefit a lot from this post: Writing the perfect question
I don't know what you are trying to do exactly with that code, but the following compiles & doesn't crash: