Analysis of Cocos2d-x errors

Source: Internet
Author: User

1. Http related:


1> libExtensions. lib (HttpClient. obj): error LNK2019: the external symbol _ imp _ pthread_create that cannot be parsed. This symbol is used in the function "private: bool _ thiscall cocos2d: extension: CCHttpClient :: lazyInitThreadSemphore (void )"(? Referenced in lazyInitThreadSemphore @ CCHttpClient @ extension @ cocos2d @ AAE_NXZ)
1> libExtensions. lib (HttpClient. obj): error LNK2019: the external symbol _ imp _ pthread_detach that cannot be parsed.
Solution: choose Project Properties> linker> Add libcurl_imp.lib and pthreadVCE2.lib to the additional dependency. Compile again and let you go.

2. When the program is compiled correctly, the following prompt is displayed during debugging:

 void CCObject::retain(void) {     CCAssert(m_uReference > 0, "reference count should greater than 0");      ++m_uReference; } void CCObject::retain(void){    CCAssert(m_uReference > 0, "reference count should greater than 0");    ++m_uReference;

} Stack debugging results are as follows:


 

cardGlobal_array=CCArray::createWithContentsOfFile("card.plist"); cardGlobal_array->retain(); cardGlobal_array=CCArray::createWithContentsOfFile("card.plist");cardGlobal_array->retain();

If there is a problem, go to the source code via F11 and check that the directory loaded by the image is incorrect. The card. plist image is not found in the default directory.

Solution: add a sub-path when loading, such as plist/card. plist.

 

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.