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;