How to speed up cocos2d-x build with prebuilt lib

How to speed up cocos2d-x build with prebuilt lib


I’ll take a look and make sure SDKBOX supports bitcode


can this way work with android studio? has anyone tried it yet?
or is it only for eclipse projects?.


Thanks. Looking forward to a fixed version. :slight_smile:


Hi, I’m using Cocos2s-x 3.5 on Lua and I’m already able to deploy on android and on my win32 simulator. I want to deploy on different platforms, specially on HTML5 and I want to create a fullscreen “real game” win32 version, not a simulator… I have lots of questions about releasing on multiplatform, do you guys have any article or wiki where I could find some information? Cocos official tutorials don’t explain this stuff =/


You you aware that in win32 the files do generated to the pre build folder with the 2013/2015 suffix
Then when creating new project it can’t find the generated lib’s .
is there any other solution or do i miss here something ?
or should i do as suggested here :


I think that post looks good, it’s basically point VS to where the prebuilt lib is, haven’t got a chance to test it though.


Thanks the problem was there is need to add the -t binary switch
so it will take the : cocos2d-x-3.10\templates\cpp-template-binary
so now the shortest way to use prebuild libs is :

cocos new -l cpp test2 -t binary

No need to change the dll names as pointed out in the post
also what is the difference between -k TEMPLATE_NAME and -t TEMPLATE_NAME
i couldn’t find any hint in the doc’s

But there are new problem, compilation/linking is working fine but there is run-time problem
the opengl context seams like never initialized
see :


I only use -t so I also don’t know what’s -k means :slight_smile:

Dose the OpenGL context issue happen with the source code version? looks like the lib has been linked, so the main objective seems to be working.


No , the source code version work just fine .
By the way did you notice that in the default download zip , the cpp-template-binary is not included
i have it only in my Cococs Studio installation dir .

i can see that the binary template source and project files are different
for example the linking of the lib’s are from main.cpp via #pragma comment(lib,…)

some wired stuff going on,
In the code i can see that i set the name of the view name like this :

 if(!glview) {
		std::string recName = "test2";
		glview = GLViewImpl::createWithRect(recName, Rect(0, 0, 960, 640));

also i can see it in memory :

but when i drill into the createWithRect function where is the exception there is no value set to the string
even so the function viewName looks like getting reference to the same memory location .


Found different and better solution for windows :


hi folks, i am using prebuild libs from version 3.10 and it is working fine now.
when i generate libs i see cocos compiles unnecessary static libs like: “cocos2d_lua_static, cocos2d_js_static, cocostudio_static, cocos3d_static, spine_static, box2d_static, recast_static, bullet_static, cocos2d_lua_android_static” that will be next linked into my project, i dont use this stuff, how to exclude that from build ?


is there a way to get this working on WP?


for iOS check “Build Phases” -> “Link Binary with Libraries”
for Android check


I have to replace …/cocos2d with …/…/cocos2d in file and run it. It’s Ok!
(My platform windows 10, cocos2d-x 3.10)


i have same problem i restart xcode but its not work for me. please help me if any you have any idea


You need to change your header search path, and library search path


which path i have to set ? . on more thing is i deleted cocos2dx folder from my test project directory



This is wrong. What you have circled is for if you are running from source. If you are using the pre-built libraries, remove the cocos2d_libx.xcodeproj and change your header search paths and library search paths to the values where you have placed the pre-built libraries.


thnx now it work fine .but it getting error in android . i attach my error and file