'cp' is not recognized as an internal or external command

3,231 views
Skip to first unread message

simo

unread,
Feb 10, 2013, 6:35:38 AM2/10/13
to haxe...@googlegroups.com

It might be easy, but, as I am newbie to haxe, I tried to run a project using custom build in FlashDevelop:

$(CompilerPath)\haxe.exe $(ProjectDir)\compile-js.hxml

, but I get this error:

'cp' is not recognized as an internal or external command,

here is the compile-js.hxml file, is there any idea how to solve this?

compile-js.hxml

#sources
-main Cocktail
-cp ../../src/
-cp src

#binary
-js bin/js/Main.js
--macro Cocktail.create('src/index.html','Main')

#copy assets directory
-cmd cp -R assets bin\js\

John Plsek

unread,
Feb 10, 2013, 7:00:16 AM2/10/13
to haxe...@googlegroups.com
last line change cp -R to copy ??? (assuming you're running windows since you're using flashdevelop) (the ??? is because I can't recall off the top of my head how to do a recursive copy in DOS, I mean windows command line)

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haxelang+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

John Plsek

unread,
Feb 10, 2013, 7:01:36 AM2/10/13
to haxe...@googlegroups.com
think XCOPY is needed - but I've given you enough to solve it for yourself

Samir Sabri

unread,
Feb 10, 2013, 7:18:57 AM2/10/13
to haxe...@googlegroups.com
cp is a haxe command, that will add a directory to find source files, not for copying files, although I have added haxe path tp the environment paths ..
still wondering why I get this error ..
--
--
Kind Regards,
--------------------------------------------- 
Samir Sabri
Software Architect& Developer
Jordan-Middle East

Axel Huizinga

unread,
Feb 10, 2013, 7:20:51 AM2/10/13
to haxe...@googlegroups.com
Hi,
CoreUtils from gnuwin32.sourceforge.net
gives you cp and much more on windoof as well

Cordially,
Axel

E-Mail ist virenfrei.
Von AVG überprüft - www.avg.de
Version: 2013.0.2897 / Virendatenbank: 2639/6072 - Ausgabedatum: 31.01.2013
Die Virendatenbank sind veraltet.


John Plsek

unread,
Feb 10, 2013, 8:28:16 AM2/10/13
to haxe...@googlegroups.com
no

-cp adds a directory to "class path"

look at the LAST line ... -cmd cp ...

cmd shells to command line, running cp ...

and installing gnu utils is extreme overkill to fix this issue

Greg Dove

unread,
Feb 10, 2013, 11:08:10 AM2/10/13
to haxe...@googlegroups.com
I think the other thing for windows is that you need to double quote-delimit the content (at least I always do anyway).

Reference from here:http://haxe.org/doc/compiler

at bottom of page: 
(if you use windows cmd.exe, use double-quote like -cmd "..." )

 so I would expect it should be -cmd "cp -R assets bin\\js\\"
(I think the backslashes need to be escaped like that...not sure)

simo

unread,
Feb 11, 2013, 1:54:09 AM2/11/13
to haxe...@googlegroups.com
Thanks, I've got your point, I have downloaded this https://github.com/bmatzelle/gow to run linux commands, and I have added an environment path to its bit folder: C:\Program Files (x86)\Gow\bin
But I still have the error:


'cp' is not recognized as an internal or external command,

I hope I can fix this, otherwise I will have to run a virtual machine!

Jason O'Neil

unread,
Feb 11, 2013, 1:59:58 AM2/11/13
to haxe...@googlegroups.com
Take a moment to understand what it is your hxml file is trying to do:


#copy assets directory
-cmd cp -R assets bin\js\

This tells Haxe to run the command `cp -R assets bin\js\` after code has been compiled.  That means - copy everything in "assets" to "bin/js".  You could delete the line from you hxml file and copy-and-paste the files manually if it makes life easier.

If you want to run a windows command, just use the equivalent whatever Window's equivalent of "cp" is, and it's probably "copy".  If this confuses you, just delete the line, and run again.  Flashdevelop should compile everything, and then you copy all the files in "assets" and paste all the files in "bin/js".

Hope this clears things up

Jason

Samir Sabri

unread,
Feb 11, 2013, 2:22:33 AM2/11/13
to haxe...@googlegroups.com
Thanks Jason, I have removed the line, and copied assets manually, now its working, it seems that Windows is not the preferable environment choice for open source projects ..

John Plsek

unread,
Feb 11, 2013, 3:09:14 AM2/11/13
to haxe...@googlegroups.com
Windows works fine with windows commands, not so good with linux commands

although, GoW fixes the cp command perfectly - perhaps you installed it wrong

Jason O'Neil

unread,
Feb 11, 2013, 3:17:33 AM2/11/13
to haxe...@googlegroups.com
Well, Windows has FlashDevelop which from what I hear is miles ahead of what we have in Linux land, and most Haxe stuff works pretty happily across platforms - it's just that the hxml file you were trying to run (presumably from a Cocktail example?) was made with Mac/Linux in mind.

Most things with Haxe don't seem to mind too much if you're on Mac or Windows or Linux, it's only small differences like this you have to keep an eye on.  I wouldn't go pulling out the virtual machines or Ubuntu install disks just yet...

Samir Sabri

unread,
Feb 11, 2013, 4:55:10 AM2/11/13
to haxe...@googlegroups.com
I see .. once I master haxe with famous js externs, I will be able to invest my AS3 skills very well, I think createjs is the way to go.

>Well, Windows has FlashDevelop which from what I hear is miles ahead of what we have in Linux land.

What's the daily tools that you use to build haxe based apps in Linux? as I use it to build Ruby On Rails apps with RubyMine

Jason O'Neil

unread,
Feb 11, 2013, 5:20:34 AM2/11/13
to haxe...@googlegroups.com
I use Sublime Text 2 with the Haxe bundle - https://github.com/clemos/haxe-sublime2-bundle

It's more of an editor than an IDE, but as far as editors go, it's my favourite :)

Samir Sabri

unread,
Feb 11, 2013, 6:47:15 AM2/11/13
to haxe...@googlegroups.com
Nice editor .. by the way, as you have worked with haxe for a while, what do you recommend to convert this swf work into HTML5? createjs or nme?

Jason O'Neil

unread,
Feb 11, 2013, 7:06:24 AM2/11/13
to haxe...@googlegroups.com

Probably a question for someone else... I'm not familiar enough with either nme or createjs.

Most of my work has been web apps using neko/js... So not much experience in that area. Hopefully someone else can help

Reply all
Reply to author
Forward
0 new messages