[英]EXC_BAD_ACCESS with wxWidgets in OSX
I'm trying to build the very first basic wxWidget
s app in OS X 10.8 with XCode 4.6. 我正在尝试使用XCode 4.6在OS X 10.8中构建第一个基本的
wxWidget
s应用程序。 I get an EXC_BAD_ACCESS
error in window SetName()
. 我在窗口
SetName()
收到EXC_BAD_ACCESS
错误。
Here is the code I used: 这是我使用的代码:
#include "main.h"
#include <wx/wx.h>
class MyApp : public wxApp
{
virtual bool OnInit();
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
wxFrame *frame = new wxFrame(NULL, -1, wxT("Hello World"), wxPoint(50, 50),
wxSize(450, 350));
frame->Show(true);
return true;
}
EDIT after comment: sorry bout that 评论后编辑:抱歉,
here is the chain of error: 这是错误链:
1) Create(parent, id, title, pos, size, style, name);
2) if (!wxTopLevelWindow::Create(parent, id, title, pos, size, style, name);
3) if (!wxNonOwnedWindow::Create(parent, id, title, pos, size, style, name))
4) setName(name);
5) m_impl = stringSrc.m_impl;
after that it's machine code 之后是机器码
Jeff 杰夫
EDIT2 : just tried with wxWidgets 3.0 and it's the same. EDIT2:刚刚尝试与wxWidgets 3.0,它是相同的。
You seem to have a bad, or at least incompatible with your program, build of wxWidgets as you absolutely shouldn't be getting the crash in wxString
assignment as you seem to do. 您似乎对wxWidgets的构建不好,或者至少与您的程序不兼容,因为您绝对不应该像看起来那样使
wxString
分配崩溃。 Plesse rebuild wxWidgets and your own application using exactly the same compiler and compilation options and the problem should just magically disappear. Plesse使用完全相同的编译器和编译选项来重建wxWidgets和您自己的应用程序,问题应该神奇地消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.