Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PLEASE HELP!!!

4 views
Skip to first unread message

John Willett

unread,
Mar 7, 2006, 12:08:31 PM3/7/06
to

Please see Messsage Number 1289, posted nearly two weeks ago, regarding version 1.0 of C++BuilderX Personal Edition (now a free download from Borland):

As indicated there, I want to develop executables (actually written in Kernighan & Ritchie C, not even in C++ as yet) that run at the Windows (2000 and, hopefully, XP) command line. In other words, I run "%SystemRoot%\system32\cmd.exe", enter "name.EXE" (followed by any required parameters) at the Command Prompt, and then see any 'printf' prompts, provide required input, and see any 'printf' output in that same console window. Unfortunately I seem to be suffering from some very basic ignorance/misunderstanding.

So far I've succeeded in building a simple example and getting it to run correctly within the BCBX IDE ('Debug Build', 'C++ Executable Application', with the run-time parameters inserted in a 'Run/Configurations.../Edit/Command line arguments' box). But when I re-build ('Release Build', otherwise the same) and run the resulting executable at the Windows Command Prompt, it completes without waiting for any input nor producing any visible prompts nor output whatsoever. I suspect that this is because I have one or more switches/options set incorrectly, but I cannot figure out what the problem is.

The help files included with BCBX aren't very helpful (at least not to a beginner), nor can I find any other useful documentation on Borland's Web site. I have I been unable to get any help from the C++Builder newsgroups. I bought a 3rd-party book on BCB, but it starts off at too high a level to answer my questions. Please help!

Message has been deleted

John Willett

unread,
Mar 7, 2006, 2:33:29 PM3/7/06
to

David Dean <ozch...@sneakemail.com> wrote:
>
> Have you looked at the project file to see what the differences are
>between the Debug and Release settings?
>
>--
>-David
>
>

David -- Thanks very much for taking the trouble to make
suggestions! If you mean what one sees in the 'Build
Options Explorer' listing of 'Effective Command Line',
yes. There are many additions in the 'Debug Build' case
(see below)...
BUT, the two versions of the build perform identically
(as far as I can see, at least), both inside the IDE and
at the Windows Command Line (as described previously),
so I would think that these differences are not the
problem.

I haven't really explored what these many
options/switches are supposed to do. I only tried to
follow the instructions in Borland's 'C++BuilderXâ„¢
Release Notes' about what additional options to set for
the Windows (as opposed to Linux or Solaris) platform.
For what it's worth, here are the command lines for the
simpler Release Build:

ILINK32: ilink32 -ap -aa -Tpe -x -Gn
-LF:\CBuilderX\lib c0x32.obj,,,cw32.lib import32.lib,,
BCC32: bcc32 -g100 -j25 -O2 -k- -vi -tWC -c
-IF:\CBuilderX\include -o
BRCC32: brcc32 -fo
Preprocess: F:\CBuilderX\bin\cpp32
-IF:\CBuilderX\include; -D -o

For the Debug Build I currently have the following:

ILINK32 ilink32 -D -ap -aa -Tpe -x -Gn -v
-LF:\CBuilderX\lib;\lib c0x32.obj,,,cw32.lib
import32.lib,,
BCC32 bcc32 -D_DEBUG -D_RTLDLL -g100 -j25 -Od -r- -k
-y -v -vi- -tWC -c -IF:\CBuilderX\include;\include -o
BRCC32 brcc32 -fo
Preprocess F:\CBuilderX\bin\cpp32
-IF:\CBuilderX\include;\include; -D_DEBUG;_RTLDLL; -o

Perhaps there's something obviously wrong here, but I'm
still clueless... -- John Willett


P.S. -- What editor should I be using for this newsgroup.
I find that, if I don't explicitly insert CR/LF (or some such),
I get endless lines in the resulting post. -- J.W.

Message has been deleted

John Willett

unread,
Mar 7, 2006, 3:42:35 PM3/7/06
to

David Dean <ozch...@sneakemail.com> wrote:
>
> I meant the actual project file. It should end with a cbx extension.
>
>


Well, I hope it's kosher to post something this long here. I can't make any sense out of it... -- John Willett


<?xml version="1.0" encoding="UTF-8"?>
<!--C++BuilderX Project-->
<project>
<property category="build.config" name="active" value="1"/>
<property category="build.config" name="count" value="1"/>
<property category="build.config" name="excludedefaultforzero" value="0"/>
<property category="build.config.0" name="builddir" value="Debug"/>
<property category="build.config.0" name="key" value="Debug_Build"/>
<property category="build.config.0" name="name" value="Debug Build"/>
<property category="build.config.0" name="settings.MinGW" value="default;debug"/>
<property category="build.config.0" name="settings.gnuc++" value="default;debug"/>
<property category="build.config.0" name="settings.intelwinia32" value="default;debug"/>
<property category="build.config.0" name="settings.mswin32" value="default;debug"/>
<property category="build.config.0" name="type" value="Toolset"/>
<property category="build.config.0" name="win32.builddir" value="windows/Debug_Build"/>
<property category="build.config.1" name="key" value="Release_Build"/>
<property category="build.config.1" name="name" value="Release Build"/>
<property category="build.config.1" name="settings.MinGW" value="default;release"/>
<property category="build.config.1" name="settings.gnuc++" value="default;release"/>
<property category="build.config.1" name="settings.intelwinia32" value="default;release"/>
<property category="build.config.1" name="settings.mswin32" value="default;release"/>
<property category="build.config.1" name="type" value="Toolset"/>
<property category="build.config.1" name="win32.builddir" value="windows/Release_Build"/>
<property category="build.node" name="name" value="JCWConsole0"/>
<property category="build.node" name="type" value="exeproject"/>
<property category="build.platform" name="active" value="win32"/>
<property category="build.platform" name="linux.default" value="gnuc++"/>
<property category="build.platform" name="linux.enabled" value="0"/>
<property category="build.platform" name="solaris.default" value="gnuc++"/>
<property category="build.platform" name="solaris.enabled" value="0"/>
<property category="build.platform" name="win32.Debug_Build.toolset" value="win32b"/>
<property category="build.platform" name="win32.MinGW.enabled" value="1"/>
<property category="build.platform" name="win32.Release_Build.toolset" value="win32b"/>
<property category="build.platform" name="win32.default" value="win32b"/>
<property category="build.platform" name="win32.gnuc++.enabled" value="0"/>
<property category="build.platform" name="win32.mswin32.enabled" value="0"/>
<property category="build.platform" name="win32.win32b.enabled" value="1"/>
<property category="cbproject" name="lastnodeid" value="8"/>
<property category="cbproject" name="version" value="X.1.0"/>
<property category="classbrowser" name="SortAlphabetically" value="1"/>
<property category="classbrowser" name="enable" value="1"/>
<property category="runtime" name="DefaultConfiguration" value="-1"/>
<property category="runtime.0" name="BuildTargetOnRun" value="com.borland.cbuilder.build.CBProjectBuilder$ProjectBuildAction;make"/>
<property category="runtime.0" name="ConfigurationName" value="JCWConsole0"/>
<property category="runtime.0" name="RunnableType" value="com.borland.cbuilder.runtime.ExecutableRunner"/>
<property category="runtime.0" name="native.exec.args" value="commandlinestring 126462925"/>
<property category="runtime.0" name="native.target.override" value="0"/>
<property category="unique" name="id" value="8"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.D.arg.1" value="_DEBUG"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.D.arg.2" value="_RTLDLL"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.D.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.I.arg.1" value="$(BCBX)\include"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.I.arg.2" value="$(VBROKER)\include"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.I.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.Od.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.V.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.a8.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.batchfilecompile.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.c.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.g.arg" value="100"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.g.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.i.arg" value="250"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.i.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.j.arg" value="25"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.j.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.k.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.o.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.r.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.responsefile.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.v.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.vi.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.y.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.brcc32" name="option.F.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.D.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Enn.arg" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Enn.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Gn.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.H:xxxx.arg" value="0x00100000"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.H:xxxx.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Hc:xxxx.arg" value="0x00001000"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Hc:xxxx.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.L.arg.1" value="$(BCBX)\lib"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.L.arg.2" value="$(VBROKER)\lib"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.L.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.S:xxxx.arg" value="0x00100000"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.S:xxxx.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Sc:xxxx.arg" value="0x00002000"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Sc:xxxx.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Tpe.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Ud.d.arg" value="1.0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Ud.d.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Vd.d.arg" value="0.0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.Vd.d.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.aa.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.b:xxxx.arg" value="0x00400000"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.b:xxxx.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.responsefile.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.v.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.x.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="param.libfiles.1" value="cw32.lib"/>
<property category="win32.Debug_Build.win32b.ilink32" name="param.libfiles.2" value="import32.lib"/>
<property category="win32.Debug_Build.win32b.ilink32" name="param.objfiles.1" value="c0x32.obj"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.I.arg.1" value="$(BCBX)\include"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.I.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.O2.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.V.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.a8.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.batchfilecompile.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.c.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.g.arg" value="100"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.g.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.i.arg" value="250"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.i.enabled" value="0"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.j.arg" value="25"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.j.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.k.enabled" value="0"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.o.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.r.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.responsefile.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.tWC.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.vi.enabled" value="1"/>
<property category="win32.Release_Build.win32b.brcc32" name="option.F.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Enn.arg" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Enn.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Gn.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.H:xxxx.arg" value="0x00100000"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.H:xxxx.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Hc:xxxx.arg" value="0x00001000"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Hc:xxxx.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.L.arg.1" value="$(BCBX)\lib"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.L.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.S:xxxx.arg" value="0x00100000"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.S:xxxx.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Sc:xxxx.arg" value="0x00002000"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Sc:xxxx.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Tpd.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Tpe.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Ud.d.arg" value="1.0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Ud.d.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Vd.d.arg" value="0.0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.Vd.d.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.aa.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.ap.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.b:xxxx.arg" value="0x00400000"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.b:xxxx.enabled" value="0"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.responsefile.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.x.enabled" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="param.libfiles.1" value="cw32.lib"/>
<property category="win32.Release_Build.win32b.ilink32" name="param.libfiles.2" value="import32.lib"/>
<property category="win32.win32b.Debug_Build" name="saved" value="1"/>
<property category="win32.win32b.Release_Build" name="saved" value="1"/>
<property category="win32b.bcc32" name="option.tWC.enabled" value="1"/>
<property category="win32b.ilink32" name="option.Tpd.enabled" value="0"/>
<property category="win32b.ilink32" name="option.Tpe.enabled" value="1"/>
<property category="win32b.ilink32" name="option.aa.enabled" value="0"/>
<property category="win32b.ilink32" name="option.ap.enabled" value="1"/>
<property category="win32b.ilink32" name="param.objfiles.1" value="c0x32.obj"/>
<file path="../PRINTLOW/PLOW.C">
<property category="unique" name="id" value="5"/>
</file>
<file path="../PRINTLOW/PLOW.H">
<property category="unique" name="id" value="7"/>
</file>
<file path="../PRINTLOW/PLOW_SB.C">
<property category="unique" name="id" value="3"/>
</file>
</project>

Message has been deleted

John Willett

unread,
Mar 8, 2006, 7:41:14 PM3/8/06
to

David Dean <ozch...@sneakemail.com> wrote:
>
> Sorry that it is taking me so long to get back to you on this. My
>Dell isn't cooperating, and most of my projects are set up for other
>platforms, so I'm still digging.
>
>--
>-David
>


David -- Thanks VERY much for your efforts. I'll hang on. -- John Willett

John Willett

unread,
Mar 21, 2006, 11:14:58 AM3/21/06
to

David Dean <ozch...@sneakemail.com> wrote:
>
> Sorry that it is taking me so long to get back to you on this. My
>Dell isn't cooperating, and most of my projects are set up for other
>platforms, so I'm still digging.
>


David -- I hope you haven't forgotten me. It's been two weeks... -- John Willett

Leo Siefert

unread,
Mar 22, 2006, 8:48:20 AM3/22/06
to
John Willett wrote:

>So far I've succeeded in building a simple example and getting it to
>run correctly within the BCBX IDE ('Debug Build', 'C++ Executable
>Application', with the run-time parameters inserted in a
>'Run/Configurations.../Edit/Command line arguments' box). But when I
>re-build ('Release Build', otherwise the same) and run the resulting
>executable at the Windows Command Prompt, it completes without
>waiting for any input nor producing any visible prompts nor output
>whatsoever. I suspect that this is because I have one or more
>switches/options set incorrectly, but I cannot figure out what the
>problem is.

Not really sure from your description what your problem is, but it
sounds like you may be passing command line parameters to the program
in the IDE, but expecting it to wait for user input when you run it
outside of the IDE. When you run in the IDE does it ask you to input
stuff, or does it simply write the output into the message window?

Here's what I did:

Newly installed CBX - first time I've used it on this computer
File | New | New Console
Accept all of the defaults except:
On step 3 of the wizard check the box to create a .cpp file
Add the following quick and dirty code in the .cpp file:

#include <iostream>
#include <stdio>

int main( int argc, char * argv[] )
{
char name[300];
printf( "Enter your name: \r\n" );
gets( name ); //please note that this is not safe code
printf( "Hello %s\r\n", name );
int x;
std::cout << "Type an integer: ";
std::cin >> x;
std::cout << "You typed: " << x;
return 0;
}

Hit the big green "Run Project" arrow

Unfortunately the IDE is a bit clumsy at handling the printf/gets
portion of the code - you have to enter your name before the prompt
for it shows - the streams portion works properly in the IDE.

Find the created executable - it's in
C:\Work\cbx\ConsoleApp1\windows\Borland\Debug_Build\ConsoleApp1.exe
as shown in the messages window.

Open a console window and navigate to the folder with the .exe.
Run ConsoleApp1.exe. Prompts for user input and writes output as
expected, then exits:

C:\Work\cbx\ConsoleApp1\windows\Borland\Debug_Build>ConsoleApp1
Enter your name:
Leo
Hello Leo
Type an integer: 45
You typed: 45
C:\Work\cbx\ConsoleApp1\windows\Borland\Debug_Build>

BTW - the help is not the best, but I did find a simple "Hello World"
app under Procedures | For Beginners that is not far different from
what I show above.

- Leo

Message has been deleted

John Willett

unread,
Mar 28, 2006, 9:27:24 AM3/28/06
to

David Dean <ozch...@sneakemail.com> wrote:
>
> I haven't forgotten you, I just haven't had the time to reinstall CBX
>on my windows machine. (It was acting very flaky) Sorry that it is
>taking so long...
>


OK David. I'm not in a big rush...

By the way, Leo Siefert's recent comment caused me to wonder
whether I'm making an even more basic mistake: It was my
understanding that, if one wanted to compile ANSI C code (as
opposed to C++), one should use the .C and .H extensions for
source code and include files, respectively (as opposed to
the .CPP extension). I read somewhere that this tells the
compiler that one is not writing in C++. Could this be part of
my problem? -- John Willett

Leo Siefert

unread,
Mar 29, 2006, 8:09:55 AM3/29/06
to
John Willett wrote:

>By the way, Leo Siefert's recent comment caused me to wonder
>whether I'm making an even more basic mistake: It was my
>understanding that, if one wanted to compile ANSI C code (as
>opposed to C++), one should use the .C and .H extensions for
>source code and include files, respectively (as opposed to
>the .CPP extension). I read somewhere that this tells the
>compiler that one is not writing in C++.

That's true. I tested it with the small app I posted by changing the
extension to .c and rebuilding. When I did, the compiler produced a
large list of errors due to the C++ code included. I then stripped
out the C++ code - the iostreams use - and the project again compiles
and runs without errors, now as a c application.

I do think that you are asking the wrong questions, though. If you
installed CBX normally, it is already set up to correctly compile the
type of project you are working on - you should not have to mess with
the project files or change any settings to make it work.

How are you creating the project you are working on? Also, what
version of CBX are you using? It's possible that you have a version
that needs a patch applied.

- Leo

John Willett

unread,
Mar 30, 2006, 9:11:30 AM3/30/06
to

Leo Siefert <lIHATESP...@senate.michigan.gov> wrote:
>
>How are you creating the project you are working on? Also, what
>version of CBX are you using? It's possible that you have a version
>that needs a patch applied.
>


Hi, Leo.

I'm creating projects by importing existing C code and editing
it in the Builder window. In the present case, I started
with .C and .H files that used to run under Microsoft Quick C
and simplified them greatly to provide a test case similar to
yours. The compiler seems happy with them. It's only their
use as free-standing console applications that is giving me
trouble with keyboard and screen I/O.

I'm using C++BuilderX Personal 1.0.0.1756 -- the only one that
Borland provides for free download. I tried to follow the
readme.html file that installed with the program, which says
that several changes should be made for Windows systems
(e.g., "On Windows, the linker option -aa is not turned on by
default for 32-bit Windows applications. Please go to the Build
Options Explorer to turn this option on"). I don't really know
what any of these mean...

By the way, the problem that you mentioned earlier about not
seeing your prompts until after you enter the required input
seems to occur because the printf buffer is not flushed to the
screen automatically. This can be fixed by putting a fflush
(stdout) statement before your gets(string) statement.

Cheers! -- John Willett

Leo Siefert

unread,
Mar 30, 2006, 12:22:25 PM3/30/06
to
John Willett wrote:

>I'm creating projects by importing existing C code and editing
>it in the Builder window.

That's what I suspected. CBX is a project oriented environment, and
you need to start by creating a project for your files. Do this:

File | New | Project and choose New Console
Name it with the name of the exe file you wish to create
Set the directory to the one with your source files
Uncheck the "Create project subdirectory" box
click Next
click Next again
make sure that create is unchecked under Wizard files
click Add button under "Imported files"
Add your .c or .cpp files to the project
click finish

The project contains the default settings for the type of project you
want to build. I no longer have the personal edition installed, but I
think all of this works the same way in that edition as it does in the
version I have. I think that you need to mess with the -aa setting
only if you are trying to build a GUI project.

When I follow these steps, I get a properly functioning stand-alone
exe that runs properly from the command line in a console window.

Note that the exe is buried rather deep in the nested folders the ide
creates. There are ways to get around that, but for now you can find
it by looking at the tooltip when the mouse pointer is over the .exe
node in the project manager.

>It's only their
>use as free-standing console applications that is giving me
>trouble with keyboard and screen I/O.

I think the default options are set to create a gui app if you do not
start with a console project.

>By the way, the problem that you mentioned earlier about not
>seeing your prompts until after you enter the required input
>seems to occur because the printf buffer is not flushed to the
>screen automatically. This can be fixed by putting a fflush
>(stdout) statement before your gets(string) statement.

Yes, I knew there was a simple fix, but I didn't remember what it was
and figured you had gotten past that.

John Willett

unread,
Mar 30, 2006, 8:49:54 PM3/30/06
to

Leo Siefert <lIHATESP...@senate.michigan.gov> wrote:
>
>File | New | Project and choose New Console
>Name it with the name of the exe file you wish to create
>Set the directory to the one with your source files

I let it create its own directory.

>Uncheck the "Create project subdirectory" box

There's no such box in my version.

>click Next
>click Next again
>make sure that create is unchecked under Wizard files
>click Add button under "Imported files"
>Add your .c or .cpp files to the project

...from their original directory in my case.

>click finish
>


Leo -- Sorry to lead you astray by being so cryptic. This is
pretty much exactly what I did, except as noted above. I still
think the problem lies in some obscure settings/options (I hope David
Dean is still working that angle), but so far I haven't had the
gumption to try to undo the instructions in the readme file to get back
to the default installation... -- John Willett

Leo Siefert

unread,
Mar 31, 2006, 7:48:53 AM3/31/06
to
John Willett wrote:

>I let it create its own directory.

Shouldn't matter.

>There's no such box in my version.

Ok, my version is newer. Not important.

>...from their original directory in my case.

Ok.

>Leo -- Sorry to lead you astray by being so cryptic. This is
>pretty much exactly what I did, except as noted above.

Good.

>I still think the problem lies in some obscure settings/options

Sounds like it. I thought you had missed the console settings and had
created a gui project which I think is the default for the compiler.

BTW - I assume that you are using the default toolset. Can you let me
know what it is called?

>(I hope David Dean is still working that angle),

Well, maybe... I just saw a message from him saying that he is having
trouble getting CBX to run on his windows machine. I will reinstall
CBX personal on one of my machines to see if I can find any reason why
that version might be different from the version I have - I know it is
an earlier version.

>I haven't had the gumption to try to undo the instructions
>in the readme file to get back
>to the default installation...

Actually, You might try just a new installation at a different
location on your computer. In my experience it seems that CBX does
not tie itself closely to Windows and I have had multiple
installations running on the same box without problems. If you do so,
you might want to make a copy of the .borland and .cbuilderx (I think
those are the correct names) folders in your Documents and Settings,
then rename them or delete them before the new installation - that way
the new version should carry all of its default settings.

For now, I don't see anything really suspicious in the postings you
have made of your settings and command lines, but will look more
closely after I reinstall CBX Personal so that I have the same playing
field - there may be some bugs in your version that have been fixed in
mine.

- Leo

Message has been deleted
Message has been deleted
0 new messages