Linux under development, to solve the Cocos2d-x in the compilation of a small problem, undefined reference to symbol & #39;p thread_create@ @GLIBC_2 .2.5& #39;

Source: Internet
Author: User

Solve a small problem with compilation in Cocos2d-x

for Cocos2d-x 2.x in the compilation, if the header file introduced the # # "Cocos-ext.h", in the C + + compilation will encounter such as the following error:


Undefined reference to symbol ' [email protected] @GLIBC_2.2.5 '/lib/x86_64-linux-gnu/libpthread.so.0:error adding Symbols:dso Missing from command line

Google on the internet for a long time, some people said to change the source code in the cocos2dx.mk of some of the configuration, I said that after the changes or the old problems, on the official website is also this answer. Seemingly change cocos2dx.mk can, but I still did not solve.

Attach the official solution: Click the Open link, for example the following


Finally find the solution in the forum, the simplest way.

In Linux under the development of C + + Cocos2d-x need to use the makefile file, directly in the Proj.linux can find makefile files. Open the file will see the original configuration, solve the above compilation problem, directly change the configuration in $log_link

The original connection is for example the following:

$ (Log_link) $ (CXX) $ (cxxflags) $ (OBJECTS)-  o [email protected] $ (sharedlibs) $ (staticlibs)

For example, the following changes have been made:

$ (Log_link) $ (CXX) $ (cxxflags) $ (OBJECTS)-wl,--no-as-needed-o [email protected] $ (sharedlibs) $ (staticlibs)

That is, add the-wl,--no-as-needed, these two key points.

The recompile is passed correctly.



Linux under development, solve Cocos2d-x in the compilation of a small problem, undefined reference to symbol & #39; [email protected]@GLIBC_2 .2.5& #39;

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.