Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!zephyr.ens.tek.com!gvgpsa!gold.gvg.tek.com!shaunc From: shaunc@gold.gvg.tek.com (Shaun Case) Newsgroups: comp.os.msdos.programmer Subject: Re: BC++ Precompiled Header Bug Message-ID: <2102@gold.gvg.tek.com> Date: 27 Mar 91 23:25:59 GMT References: <1991Mar22.170134.11852@athena.mit.edu> Organization: Grass Valley Group, Grass Valley, CA Lines: 66 In article <1991Mar22.170134.11852@athena.mit.edu> ahodgson@athena.mit.edu (Antony Hodgson) writes: >I just reported the following bug involving precompiled headers to Borland. [bug deleted] >If one builds this program with precompiled headers ON, then it runs fine. ... >is fine. Turning precompiled headers off solves the problem, but that >definitely defeats the purpose of precompilation. I had a completely different problem with the precompiled headers in BC++ 2.0, which I reported to Tech Support. I had an application in which command line arguments suddenly quit working. That is, argc was zero, and argv[1] (and even argv[0]) was/were NULL. Turning off the precompiled headers fixed it; another thing that fixed it was changing one of my #defines. It seems that someone else had called in before me, and had the following line as the first line in one of his/her #include files: #define A 0 The closest thing I could find was the line #define VERSION "0.00" as the first line in one of my include files. I changed it to #define VERSION "1.00" and everything started working again, both with and without the precompiled headers. However, as my application continued to grow, the problem cropped up again; I went through #define VERSION "1.10" and #define VERSION "1.11" as my code and data increased. Each time it sovled the problem temporarily. Now, I am using #define VERSION "1.111" and am wondering what version my program will be when it is released! :-) If it happens again, I am going to insert a new line like #define DUMMY 1 and see if that helps. What's really odd is that the other person's problem dealt with a numerical value, and mine deals with a string, although the symptoms are the same. Anyhow, if anyone is having trouble with an argc=0 bug, try either eliminating use of precompiled headers, or changingany #define in an include file that is 1) The first #define in the file, AND 2) defined to be 0 or some string with zeros in it. Happy hacking! Shaun. -- Shaun Case: shaunc@gold.gvg.tek.com or atman%ecst.csuchico.edu@RELAY.CS.NET or Shaun Case of 1:119/666.0 (Fidonet) or 1@9651 (WWIVnet) --- It's enough to destroy a young moose's faith!