how to merge both cpp and js support in cocos2d to use via command prompt

367 views Asked by At

How can I create the C++ project and create the js project using the same console?

I download cocos2d-x 3.6 for cpp and cocos2d-js 3.6.1 for js support and had extracted the zip and run setup.py contained in both.

But , When i run the command

 C:/>cocos new myJsGame -l cpp     

It gives the error:

Fatal: can't find any template for language in C:\cocos2d-js v3.6.1\templates
You can specify the path of cocos2d-x by argument '-e'.

I Know that for using cpp support i must specify the cocos2d-x path for cpp which i had downloaded.

But is there any way by which i could use both cpp and js in console without specifying the path always when creating a new cocos project.

2

There are 2 answers

0
Sebastián Vansteenkiste On

cocos new -l js should create a new JS project with also the JS-bindings for Android and windows, including C++ sources.

0
yangguang1029 On

copy cpp-template-default and cocos2dx_files.json from cocos2d-x v3.6/templates to cocos2d-js v3.6.1/templates. i tried,and it works.