Author Topic: "custom commands" bug?  (Read 12038 times)

sés

  • Guest
"custom commands" bug?
« on: February 10, 2005, 10:37:12 pm »
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:
Code
copy bgl.h ..\include


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


What am I doing wrong?

Thanks.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
"custom commands" bug?
« Reply #1 on: February 11, 2005, 12:01:19 am »
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

  • Guest
"custom commands" bug?
« Reply #2 on: February 11, 2005, 12:09:49 pm »
I tried it:

Quote
Project   : 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

  • Guest
"custom commands" bug?
« Reply #3 on: February 11, 2005, 12:58:58 pm »
Paths? Try to execute this command manually from the project directory.

sés

  • Guest
"custom commands" bug?
« Reply #4 on: February 11, 2005, 01:40:09 pm »
All files are in the same directory.
You can see the compiler commands:
Quote
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"

mre.cpp is there and the comands work. Only the "copy" fails.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
"custom commands" bug?
« Reply #5 on: February 11, 2005, 02:04:47 pm »
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...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
"custom commands" bug?
« Reply #6 on: February 11, 2005, 02:07:33 pm »
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

  • Guest
"custom commands" bug?
« Reply #7 on: February 11, 2005, 02:12:56 pm »
Ok, it works using a batch file... ¬¬
I think I'll download unxutils

Cyrano_1968

  • Guest
Re: "custom commands" bug?
« Reply #8 on: December 31, 2005, 07:45:20 pm »
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



Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: "custom commands" bug?
« Reply #9 on: December 31, 2005, 07:57:29 pm »
Actually, 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."

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: "custom commands" bug?
« Reply #10 on: December 31, 2005, 08:14:49 pm »
You guys realize you're replying to a thread that's over 10 months old, right?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: "custom commands" bug?
« Reply #11 on: December 31, 2005, 08:20:26 pm »
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

  • Guest
Re: "custom commands" bug?
« Reply #12 on: December 31, 2005, 11:35:25 pm »
> 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!!