[Cocos2d-x] [APK Package][fatal signal 11][andriod]eclipse compilation Fatal Signal 11 error-All words assigned value to blame

Source: Internet
Author: User
Tags addchild


Process Recurrence:

Using Coco2d-x to make a 2048, in the Xcode simulator run and Real machine debugging on the pad is no problem, but in the use of Eclipse debugging packaged Android can run, but after entering the game will be in a random place to flash back, debug mode error:

10-20 11:48:36.413:a/libc (17408): Fatal signal (SIGSEGV) at 0x68d7b0b8 (code=2), Thread 17426 (Thread-7958)

On the internet to find out about the problem of N, including Android version errors and so on, and finally found that the problem is the assignment string caused by the memory overflow, the reason to run on iOS is no problem because iOS allocated more memory than Android,

The error code is as follows:

. hint select;std::string SS;.     C std::string ss= "Bland";    Auto Select2=label::createwithsystemfont (Stringutils::format ("%s", Ss.c_str ()), "", 30);    This->addchild (SELECT2);            Select2->settag (this->select=random);%6;            Cclog ("s=%d", select);                    Switch (this->select) {case 0:ss= "bland";                Break                    Case 1:ss= "Both worlds";                Break                    Case 2:ss= "heaven";                Break                    Case 3:ss= "Smoke four";                Break                    Case 4:ss= "Zhuang Zhou Dream Butterfly";                Break                    Case 5:ss= "The past of the red Dust";                Break            Default:break;       } Auto Lb= (Label *) This->getchildbytag (220); Lb->setstring (ss);

Solution Set Character array

Code

. hint Select;std::string SS; char* selectstr[6]=    {"Bland", "smooth and Smooth", "heaven", "Smoke Four", "Zhuang Zhou Dream Butterfly", "Red Dust Past"};. C std::string ss= "Bland";     Auto Select2=label::createwithsystemfont (Stringutils::format ("%s", Ss.c_str ()), "", "(");    This->addchild (SELECT2);    Select2->settag (this->select=random);%6;                   Auto lb= (Label *) This->getchildbytag ();      Lb->setstring (Selectstr[select]);


This shows that the assignment of a string cannot take the usual "=" to cause a memory overflow problem.

[Cocos2d-x] [APK Package][fatal signal 11][andriod]eclipse compilation Fatal Signal 11 error-All words assigned value to blame

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.