Creating new projects using prebuilt libs

I was just wondering if theres a way to generate a project with the command line tool and use the prebuilt libraries, because, everytime I generate a new project it comes with the whole cocos2dx project

Create an app with cocos2d-x, set cocos2d-x as shared directory (somewhere outside),
then just copy this “template” app. Don’t forget to overwrite the project identifiers.

http://cocos2d-x.org/docs/editors_and_tools/cocosCLTool/index.html#using-the-pre-built-libraries-in-your-projects

1 Like

page not found… =/

Corrected. Sorry I was on my phone and the link did not paste correctly for some reason.

after building both debug and release versions of win32 projects, i tried to use:
cocos new ProjectName -p projectname.com.name -l cpp -t binary

but all it says to me is:

Template named ‘binary’ is not found.
Multiple templates detected!
You can select one via -t argments.

I mean, the libraries I built are all inside “cocos2dx/tools/simulator/frameworks/”, how can I tell cocos to use that on the templates???

Please someone can help me, i really need to know about this

cocos gen-templates

cocos new ProjectName -p projectname.com.name -l cpp -t binary

i tried this, i swear, but its complaining about the “-t binary” argument, its saying that “binary” should be a template, but i dont see any template called binary

lemme try again, maybe i did something wrong, thanks for answer me !

hmm, maybe there is a problem building the libraries for win32 apps.

actually the problem is me, i forgot about the “cocos gen-templates”, its kinda obvious why it didnt worked --’, thank you!

sure. I am adding better language for this step. I actually didn’t realize it was required either.

This is no longer a recognised option of the command line tool:

cocos gen-templates

I get this on 3.16 today when I try to use it:

Error: argument 'gen-templates' not found.

What is the current way to create new projects using binaries from the command line?

cocos gen-libs --help

Thanks for your help. I see nothing there about generating a project which references the prebuilt libs. Am I correct in surmising there is no such generator anymore?

Is the recommended method now to generate a new game the default way and then go in and delete the copied cocos source and hack up the build tool projects manually to reference the pre-built libs?

Oh, I see what you are asking. Good question. The answer is, probably.

I generate the libraries, drop them into XCode and then change my header and include search path. Done. For Android You need to reference the libs in your jni/Android.mk

1 Like

Thank you :-).

And I guess the step before what you describe is to make a new project with:

cocos new MyGame -p com.MyCompany.MyGame -l cpp -d ~/MyCompany

and scrape away the cocos library code.

Look in Application.mk and Android.mk for most of the details.

use cocos gen-libs … to generate the libraries.