News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

"custom commands" bug?

Started by sés, February 10, 2005, 10:37:12 PM

Previous topic - Next topic

sés

Hi, I just downloaded beta5 and it seems awesome! Unfortunately I have a little problem :(

I'm trying to use "custom commands" and I can't make it work.
My project compile, but if I add the following line:
copy bgl.h ..\include

I get this:
Running post-build step: default
Command execution failed...


What am I doing wrong?

Thanks.

mandrav

Go to global compiler options and change the logging level for the compiler you 're using to "Full". Rebuild your project and post here the full build log.
Also, when you get the "Command execution failed" message, the exact command that failed should be printed in the debug log. Check it there... (to enable the debug log, go to environment options, enable it and then restart CB).

Yiannis.
Be patient!
This bug will be fixed soon...

sés

I tried it:

QuoteProject   : Console application
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\moises\mre\
--------------------------------------------------------------------------------
Switching to target: default
mingw32-g++.exe      -I"C:\\MinGW\\include"  -c "mre.cpp" -o ".objs\\mre.o"
mingw32-g++.exe   -L"C:\\MinGW\\lib"  -o "mre.exe"   -L"C:\\MinGW\\lib"  ".objs\\mre.o"    
copy mre.cpp ..
Command execution failed...

It just doesn't work :(
It compiles fine, but fails when try to execute a single "copy".

mike

Paths? Try to execute this command manually from the project directory.

sés

All files are in the same directory.
You can see the compiler commands:
Quotemingw32-g++.exe -I"C:\\MinGW\\include" -c "mre.cpp" -o ".objs\\mre.o"
mingw32-g++.exe -L"C:\\MinGW\\lib" -o "mre.exe" -L"C:\\MinGW\\lib" ".objs\\mre.o"
mre.cpp is there and the comands work. Only the "copy" fails.

mandrav

I use custom comands in the CB project file itself. In the custom commands I just add "update.bat" (no quotes) and I have a file called "update.bat" which contains the commands to be executed. Can you try it this way and post the results?

Yiannis.
Be patient!
This bug will be fixed soon...

mandrav

Actually, under windows, I think ShellExecute() is called in this situation (by wxWidgets, under the hood).
"Copy" is doomed to fail, if that is so because it's a built-in command, not an executable. In this case you have two options:
a) do it like I told you (create a batch file and call it), or
b) install unxutils which contain cp.exe, rm.exe etc, and use these in your custom commands

HTH,
Yiannis.
Be patient!
This bug will be fixed soon...

sés

Ok, it works using a batch file... ¬¬
I think I'll download unxutils

Cyrano_1968

Hi,

I tried to solve this problem in this way: I inserterd in the "post-build steps" the command:

cmd /c copy "*.h" "C:\Include\*.h"

(The folder "C:\Include" is just an example, of course).

It's important to use cmd.exe with the parameter /c, otherwise it won't terminate its execution and your CodeBlocks will be waiting for it undefinitely.

Bye Bye... Cyrano



thomas

Quote from: mandrav on February 11, 2005, 02:07:33 PMActually, under windows, I think ShellExecute() is called in this situation (by wxWidgets, under the hood).
No, CreateProcessEx is used. That's why copy does not work. If you execute update.bat, the default application for .bat will be started (which is cmd). But if you execute copy, it fails because there is no copy.exe anywhere (copy is a builtin command).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Urxae

You guys realize you're replying to a thread that's over 10 months old, right?

thomas

No :lol:

It showed "Today" for me... do I have to hide under a rock now?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

xnhcoder

> You guys realize you're replying to a thread that's over 10 months old, right?

Even though the problem be old, if the solution is a good one, I say, "Post it."

Happy New Year!!