Author Topic: Continue on "status 1"  (Read 3168 times)

Offline grunerite

  • Multiple posting newcomer
  • *
  • Posts: 41
Continue on "status 1"
« on: March 15, 2006, 03:21:26 am »
1.0 revision 2189 - Nightly Build - unicode


I need help with some commands in pre-build step. I am running the MS HTML Help compiler to generate some compiled Help in a pre-build step, and although the compiled help builds perfectly fine, I get an "Process terminated with status 1", and building stops. One can argue the problem is with the Help Compiler, but nonetheless I'm looking for a way to complete the building (without using a bat file, which does work).

The pre-build steps I want to use look like this:

cmd /c if NOT EXIST Help MKDIR Help
cmd /c hhc.exe Help_App.hhp
cmd /c mv Help mgcc\Release

There are a couple of problems, but the main problem is associated with line 2.  Using the above steps, the Build Log is this:

-------------- Build: mingw_Release in Help ---------------
Running target pre-build steps
cmd /c if NOT EXIST Help MKDIR Help
cmd /c hhc.exe Help_App.hhp
Microsoft HTML Help Compiler 4.74.8702
Compiling c:\Dev\VCF\vcf\examples\Help\Help\Help_App.chm
Compile time: 0 minutes, 2 seconds
1   Topic
0   Local links
0   Internet links
0   Graphics
Created c:\Dev\VCF\vcf\examples\Help\Help\Help_App.chm, 11,903 bytes
Compression increased file by 7,763 bytes.
Process terminated with status 1 (0 minutes, 4 seconds)
0 errors, 0 warnings

I'm guessing the help compiler is not returning the status it should, perhaps because of the last line about Compression inreased file size (again, the compiled help is just fine). What I am looking for is the syntax that allows me to achieve my goal, but have building continue, and not terminated. I have found an ugly way to do it that uses a START command:

cmd /c "START /WAIT cmd /c hhc.exe Help_App.hhp&&mv Help mgcc\Release"

but this opens up the ugly command window while building the Help.

Is there a way to get Code::Blocks to continue building here, without using START?

I know there was a post about something similar in the last 4 months, but I cannot find it.


Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Continue on "status 1"
« Reply #1 on: March 15, 2006, 07:52:34 am »
you could write a small wrapper program for your application, which always returns 0

#include <stdio.h>
#include <stdlib.h>

int main()
system ("hhc.exe Help_App.hhp");
return 0;

and set the target type as "GUI application" in order to get rid of the command-window.

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Continue on "status 1"
« Reply #2 on: March 15, 2006, 02:24:34 pm »
Yes, I once get mad with the Help Compiler because it always returns 1.

The tiwag's solution should work. :)

Offline grunerite

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Continue on "status 1"
« Reply #3 on: March 15, 2006, 05:42:22 pm »
Hi guys,

Thanks for the solution. I think I will just go ahead and do it through a batch file for right now (I just hate depending on batch files). This is one of about 40 example apps in a SF project, and I don't want to add a whole new app for downloaders to build just to compile some integrated Help for another app. Perhaps I could do this with AngelScript, but I (unfortunately) just haven't found the time to figure it out (at least not yet).

Thanks, and keep up the good work!