Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
$ mkdir ./linux-build
$ cd ./linux-build/
$ cmake -GNinja ../
$ ninja
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
It appears you are building natively for Linux with GCC
-- Found OpenGL: /usr/lib64/libGL.so
-- OpenGL include dirs: /usr/include
-- Found GLEW: /usr/include
-- GLEW include dirs: /usr/include
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- PkgConfig found
-- checking for module 'glfw3'
-- found glfw3, version 3.2.0
-- GLFW3 include dirs: /usr/local/include/GLFW
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- SQLite3 include dirs: /usr/include
-- FMOD include dirs: /opt/cocos2d-x/external/linux-specific/fmod/include
-- checking for one of the modules 'fontconfig'
-- Found Fontconfig: TRUE (found version "2.11.1")
-- Fontconfig include dirs: /usr/include/freetype2
-- Found GTK3: gtk-3;gdk-3;pangocairo-1.0;pango-1.0;atk-1.0;cairo-gobject;cairo;gdk_pixbuf-2.0;gio-2.0;gobject-2.0;glib-2.0
-- GTK3 include dirs: /usr/include/gtk-3.0;/usr/include/cairo;/usr/include/pixman-1;/usr/include/libdrm;/usr/include/gdk-pixbuf-2.0;/usr/include/libpng16;/usr/include/atk-1.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include;/usr/include/pango-1.0;/usr/include/freetype2;/usr/include/harfbuzz;/usr/include/gio-unix-2.0/;/usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- Freetype include dirs: /opt/cocos2d-x/external/freetype2/include/linux;/opt/cocos2d-x/external/freetype2/include/linux
-- WebP include dirs: /opt/cocos2d-x/external/webp/include/linux
-- Chipmunk include dirs: /opt/cocos2d-x/external/chipmunk/include
-- Bullet include dirs: /opt/cocos2d-x/external/bullet
-- Recast include dirs: /opt/cocos2d-x/external/recast
-- TinyXML2 include dirs: /opt/cocos2d-x/external/tinyxml2
-- JPEG include dirs: /opt/cocos2d-x/external/jpeg/include/linux
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- ZLIB include dirs: /usr/include
-- MINIZIP include dirs: /opt/cocos2d-x/external/unzip;/usr/include
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.28+apng")
-- PNG include dirs: /usr/include;/usr/include
-- TIFF include dirs: /opt/cocos2d-x/external/tiff/include/linux
-- WEBSOCKETS include dirs: /opt/cocos2d-x/external/websockets/include/linux
-- CURL include dirs:
-- Flatbuffers include dirs: /opt/cocos2d-x/external
-- OPENGL add to include_dirs: /usr/include
-- OPENGL libs added to 'cocos2dInternal': /usr/lib64/libGLU.so;/usr/lib64/libGL.so
-- GLEW add to include_dirs: /usr/include
-- GLEW libs added to 'cocos2dInternal': /usr/lib64/libGLEW.so
-- GLFW3 add to include_dirs: /usr/local/include/GLFW
-- GLFW3 add to link_dirs: /usr/local/lib
-- GLFW3 libs added to 'cocos2dInternal': glfw
-- GLFW3 add definitions: -DGLFW_DLL
-- FMOD add to include_dirs: /opt/cocos2d-x/external/linux-specific/fmod/include
-- FMOD libs added to 'cocos2dInternal': /opt/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so;/opt/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so
-- FONTCONFIG add to include_dirs: /usr/include/freetype2
-- FONTCONFIG libs added to 'cocos2dInternal': fontconfig;freetype
-- THREADS libs added to 'cocos2dInternal': -lpthread
-- GTK3 add to include_dirs: /usr/include/gtk-3.0;/usr/include/cairo;/usr/include/pixman-1;/usr/include/libdrm;/usr/include/gdk-pixbuf-2.0;/usr/include/libpng16;/usr/include/atk-1.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include;/usr/include/pango-1.0;/usr/include/freetype2;/usr/include/harfbuzz;/usr/include/gio-unix-2.0/;/usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- GTK3 libs added to 'cocos2dInternal': gtk-3;gdk-3;pangocairo-1.0;pango-1.0;atk-1.0;cairo-gobject;cairo;gdk_pixbuf-2.0;gio-2.0;gobject-2.0;glib-2.0
-- GTK3 add definitions: -pthread
-- ZLIB add to include_dirs: /usr/include
-- ZLIB libs added to 'cocos2dInternal': /usr/lib64/libz.so
-- MINIZIP add to include_dirs: /opt/cocos2d-x/external/unzip;/usr/include
-- MINIZIP libs added to 'cocos2dInternal': unzip;/usr/lib64/libz.so
-- JPEG add to include_dirs: /opt/cocos2d-x/external/jpeg/include/linux
-- JPEG libs added to 'cocos2dInternal': /opt/cocos2d-x/external/jpeg/prebuilt/linux/64-bit/libjpeg.a
-- PNG add to include_dirs: /usr/include;/usr/include
-- PNG libs added to 'cocos2dInternal': /usr/lib64/libpng.so;/usr/lib64/libz.so
-- TIFF add to include_dirs: /opt/cocos2d-x/external/tiff/include/linux
-- TIFF libs added to 'cocos2dInternal': /opt/cocos2d-x/external/tiff/prebuilt/linux/64-bit/libtiff.a
-- TinyXML2 add to include_dirs: /opt/cocos2d-x/external/tinyxml2
-- TinyXML2 libs added to 'cocos2dInternal': tinyxml2
-- FREETYPE add to include_dirs: /opt/cocos2d-x/external/freetype2/include/linux;/opt/cocos2d-x/external/freetype2/include/linux
-- FREETYPE libs added to 'cocos2dInternal': /opt/cocos2d-x/external/freetype2/prebuilt/linux/64-bit/libfreetype.a
-- WEBSOCKETS add to include_dirs: /opt/cocos2d-x/external/websockets/include/linux
-- WEBSOCKETS libs added to 'cocos2dInternal': /opt/cocos2d-x/external/websockets/prebuilt/linux/64-bit/libwebsockets.a
-- CURL libs added to 'cocos2dInternal': curl
-- OPENSSL add to include_dirs: /opt/cocos2d-x/external/openssl/include/linux
-- OPENSSL libs added to 'cocos2dInternal': /opt/cocos2d-x/external/openssl/prebuilt/linux/64-bit/libssl.a;/opt/cocos2d-x/external/openssl/prebuilt/linux/64-bit/libcrypto.a
-- FLATBUFFERS add to include_dirs: /opt/cocos2d-x/external
-- XXHASH add to include_dirs: /opt/cocos2d-x/external/xxhash
-- XXHASH libs added to 'cocos2dInternal': xxhash
-- WEBP add to include_dirs: /opt/cocos2d-x/external/webp/include/linux
-- WEBP libs added to 'cocos2dInternal': /opt/cocos2d-x/external/webp/prebuilt/linux/64-bit/libwebp.a
-- CHIPMUNK add to include_dirs: /opt/cocos2d-x/external/chipmunk/include
-- CHIPMUNK libs added to 'cocos2dInternal': /opt/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a
-- BULLET add to include_dirs: /opt/cocos2d-x/external/bullet
-- BULLET libs added to 'cocos2dInternal': bullet
-- RECAST add to include_dirs: /opt/cocos2d-x/external/recast
-- RECAST libs added to 'cocos2dInternal': recast
-- FONTCONFIG include dirs: /usr/include/freetype2
-- GTK3 include dirs: /usr/include/gtk-3.0;/usr/include/cairo;/usr/include/pixman-1;/usr/include/libdrm;/usr/include/gdk-pixbuf-2.0;/usr/include/libpng16;/usr/include/atk-1.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include;/usr/include/pango-1.0;/usr/include/freetype2;/usr/include/harfbuzz;/usr/include/gio-unix-2.0/;/usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- FREETYPE include dirs: /opt/cocos2d-x/external/freetype2/include/linux;/opt/cocos2d-x/external/freetype2/include/linux
-- CURL include dirs:
-- FONTCONFIG add to include_dirs: /usr/include/freetype2
-- FONTCONFIG libs added to 'cpp-tests': fontconfig;freetype
-- GTK3 add to include_dirs: /usr/include/gtk-3.0;/usr/include/cairo;/usr/include/pixman-1;/usr/include/libdrm;/usr/include/gdk-pixbuf-2.0;/usr/include/libpng16;/usr/include/atk-1.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include;/usr/include/pango-1.0;/usr/include/freetype2;/usr/include/harfbuzz;/usr/include/gio-unix-2.0/;/usr/include/glib-2.0;/usr/lib64/glib-2.0/include
-- GTK3 libs added to 'cpp-tests': gtk-3;gdk-3;pangocairo-1.0;pango-1.0;atk-1.0;cairo-gobject;cairo;gdk_pixbuf-2.0;gio-2.0;gobject-2.0;glib-2.0
-- GTK3 add definitions: -pthread
-- FREETYPE add to include_dirs: /opt/cocos2d-x/external/freetype2/include/linux;/opt/cocos2d-x/external/freetype2/include/linux
-- FREETYPE libs added to 'cpp-tests': /opt/cocos2d-x/external/freetype2/prebuilt/linux/64-bit/libfreetype.a
-- CURL libs added to 'cpp-tests': curl
SPIDERMONKEY_LIBRARY: /opt/cocos2d-x/external/spidermonkey/prebuilt/linux/64-bit/libjs_static.a
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/cocos2d-x/linux-build
[44/1079] Building CXX object external.../CollisionShapes/btCompoundShape.cpp.o
/opt/cocos2d-x/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.cpp: In member function ‘void btCompoundShape::addChildShape(const btTransform&, btCollisionShape*)’:
/opt/cocos2d-x/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.cpp:81:58: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
^
/opt/cocos2d-x/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.cpp: In member function ‘void btCompoundShape::createAabbTreeFromChildren()’:
/opt/cocos2d-x/external/bullet/BulletCollision/CollisionShapes/btCompoundShape.cpp:315:68: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
^
[455/1079] Building CXX object cocos/C...i/UIEditBox/UIEditBoxImpl-common.cpp.o
/opt/cocos2d-x/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp: In member function ‘void cocos2d::ui::EditBoxImplCommon::editBoxEditingDidEnd(const string&, cocos2d::ui::EditBoxDelegate::EditBoxEndAction)’:
/opt/cocos2d-x/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp:357:49: warning: ‘virtual void cocos2d::ui::EditBoxDelegate::editBoxEditingDidEnd(cocos2d::ui::EditBox*)’ is deprecated [-Wdeprecated-declarations]
pDelegate->editBoxEditingDidEnd(_editBox);
^
In file included from ../cocos/ui/UIEditBox/UIEditBoxImpl.h:29:0,
from ../cocos/ui/UIEditBox/UIEditBoxImpl-common.h:32,
from /opt/cocos2d-x/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp:26:
../cocos/ui/UIEditBox/UIEditBox.h:80:46: note: declared here
CC_DEPRECATED_ATTRIBUTE virtual void editBoxEditingDidEnd(EditBox* editBox) {};
^
[464/1079] Building CXX object cocos/C...2dInternal.dir/network/WebSocket.cpp.o
FAILED: cocos/CMakeFiles/cocos2dInternal.dir/network/WebSocket.cpp.o
/usr/bin/c++ -DCC_ENABLE_BOX2D_INTEGRATION=0 -DCC_ENABLE_BULLET_INTEGRATION=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_USE_3D_PHYSICS=1 -DCC_USE_NAVMESH=1 -DCC_USE_WEBP=1 -DGLFW_DLL -DLINUX -I../ -I../cocos -I../deprecated -I../cocos/platform -I../extensions -I../external -I/usr/local/include/GLFW -I../cocos/../external/ConvertUTF -I../cocos/../external/poly2tri -I../cocos/../external/poly2tri/common -I../cocos/../external/poly2tri/sweep -I/usr/include/GLFW -I../cocos/../external -I../cocos/../external/edtaa3func -I../cocos/editor-support -I../cocos/../../extensions -I../cocos/../external/xxtea -I../cocos/../external/clipper -I../external/linux-specific/fmod/include -I/usr/include/freetype2 -I/usr/include/gtk-3.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I../external/unzip -I../external/jpeg/include/linux -I../external/tiff/include/linux -I../external/tinyxml2 -I../external/freetype2/include/linux -I../external/websockets/include/linux -I../external/openssl/include/linux -I../external/xxhash -I../external/webp/include/linux -I../external/chipmunk/include -I../external/bullet -I../external/recast -std=c++11 -Wno-deprecated-declarations -Wno-reorder -Wno-invalid-offsetof -fPIC -O3 -DNDEBUG -pthread -MD -MT cocos/CMakeFiles/cocos2dInternal.dir/network/WebSocket.cpp.o -MF cocos/CMakeFiles/cocos2dInternal.dir/network/WebSocket.cpp.o.d -o cocos/CMakeFiles/cocos2dInternal.dir/network/WebSocket.cpp.o -c /opt/cocos2d-x/cocos/network/WebSocket.cpp
/opt/cocos2d-x/cocos/network/WebSocket.cpp: In function ‘lws_context_creation_info cocos2d::network::convertToContextCreationInfo(const lws_protocols*, bool)’:
/opt/cocos2d-x/cocos/network/WebSocket.cpp:228:24: error: ‘LWS_SERVER_OPTION_EXPLICIT_VHOSTS’ was not declared in this scope
info.options = LWS_SERVER_OPTION_EXPLICIT_VHOSTS | LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp:228:60: error: ‘LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT’ was not declared in this scope
info.options = LWS_SERVER_OPTION_EXPLICIT_VHOSTS | LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp:232:24: error: ‘LWS_SERVER_OPTION_EXPLICIT_VHOSTS’ was not declared in this scope
info.options = LWS_SERVER_OPTION_EXPLICIT_VHOSTS | LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT | LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED;
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp:232:60: error: ‘LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT’ was not declared in this scope
info.options = LWS_SERVER_OPTION_EXPLICIT_VHOSTS | LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT | LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED;
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp: In member function ‘lws_vhost* cocos2d::network::WebSocket::createVhost(lws_protocols*, int&)’:
/opt/cocos2d-x/cocos/network/WebSocket.cpp:838:45: error: ‘LCCSCF_ALLOW_SELFSIGNED’ was not declared in this scope
sslConnection = sslConnection | LCCSCF_ALLOW_SELFSIGNED | LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp:838:71: error: ‘LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK’ was not declared in this scope
sslConnection = sslConnection | LCCSCF_ALLOW_SELFSIGNED | LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp:842:59: error: ‘lws_create_vhost’ was not declared in this scope
lws_vhost* vhost = lws_create_vhost(__wsContext, &info);
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp: In member function ‘void cocos2d::network::WebSocket::onClientOpenConnectionRequest()’:
/opt/cocos2d-x/cocos/network/WebSocket.cpp:877:29: error: ‘LCCSCF_USE_SSL’ was not declared in this scope
sslConnection = LCCSCF_USE_SSL;
^
/opt/cocos2d-x/cocos/network/WebSocket.cpp:912:21: error: ‘struct lws_client_connect_info’ has no member named ‘vhost’
connectInfo.vhost = vhost;
^
[469/1079] Building CXX object cocos/C...al.dir/network/CCDownloader-curl.cpp.o
ninja: build stopped: subcommand failed.
Steps to Reproduce: