Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #91382 > unrolled thread

Please refrain from discussing religion here!!

Started byReal Troll <real.troll@trolls.com>
First post2016-07-31 00:00 -0300
Last post2016-08-02 00:30 -0400
Articles 17 — 11 participants

Back to article view | Back to comp.lang.c


Contents

  Please refrain from discussing religion here!! Real Troll <real.troll@trolls.com> - 2016-07-31 00:00 -0300
    Re: Please refrain from discussing religion here!! gazelle@shell.xmission.com (Kenny McCormack) - 2016-07-31 08:38 +0000
    Re: Please refrain from discussing religion here!! "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-07-31 04:01 -0700
      Re: Please refrain from discussing religion here!! David Brown <david.brown@hesbynett.no> - 2016-08-01 10:01 +0200
        Re: Please refrain from discussing religion here!! Richard Heathfield <rjh@cpax.org.uk> - 2016-08-01 09:18 +0100
        Re: Please refrain from discussing religion here!! gazelle@shell.xmission.com (Kenny McCormack) - 2016-08-01 12:36 +0000
          Re: Please refrain from discussing religion here!! Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-08-01 05:55 -0700
            Re: Please refrain from discussing religion here!! "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-08-01 06:12 -0700
        Re: Please refrain from discussing religion here!! Keith Thompson <kst-u@mib.org> - 2016-08-01 08:37 -0700
          Re: Please refrain from discussing religion here!! David Brown <david.brown@hesbynett.no> - 2016-08-01 22:33 +0200
            Re: Please refrain from discussing religion here!! "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-08-01 15:31 -0700
              Re: Please refrain from discussing religion here!! fir <profesor.fir@gmail.com> - 2016-08-01 18:30 -0700
    Re: Please refrain from discussing religion here!! Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2016-07-31 14:04 -0400
    Re: Please refrain from discussing religion here!! Real Troll <real.troll@trolls.com> - 2016-07-31 15:33 -0400
    Re: Please refrain from discussing religion here!! Jason Benjamin <hexusnexus@gmail.com> - 2016-08-02 03:40 +0000
      Re: Please refrain from discussing religion here!! Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-08-01 21:44 -0600
    Re: Please refrain from discussing religion here!! Real Troll <real.troll@trolls.com> - 2016-08-02 00:30 -0400

#91382 — Please refrain from discussing religion here!!

FromReal Troll <real.troll@trolls.com>
Date2016-07-31 00:00 -0300
SubjectPlease refrain from discussing religion here!!
Message-ID<nnjn0d$uff$1@gioia.aioe.org>

It is time to stop discussing religion and instead we should start 
serious discussion about C.  Lets start with something simple:

1) This program does a very simple thing but it is amazing it can do 
this with ease:

> #pragma hdrstop
> #pragma argsused
>
> #include <stdio.h>
>
> #ifdef _WIN32
> #include <tchar.h>
> #else
>   typedef char _TCHAR;
>   #define _tmain main
> #endif
>
> int _tmain(int argc, _TCHAR* argv[])
> {
>     printf ("Hello, World");
>     getch();
>     return 0;
> }



2) when you run this program, you will get a black screen like this:

<https://s31.postimg.org/ewov7f7uz/black_screen.png>

3) We can now go and improve this program and expand it to do something 
valuable.

4) I hope you all enjoyed this.

[toc] | [next] | [standalone]


#91384

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2016-07-31 08:38 +0000
Message-ID<nnkdep$bf1$3@news.xmission.com>
In reply to#91382
In article <nnjn0d$uff$1@gioia.aioe.org>,
Real Troll  <real.troll@trolls.com> wrote:
>
>
>It is time to stop discussing religion and instead we should start 
>serious discussion about C.  Lets start with something simple:
>
>1) This program does a very simple thing but it is amazing it can do 
>this with ease:

Well done, sir!

Of course, your program is much more off-topic than are Rick's religious
posts.

-- 
The randomly chosen signature file that would have appeared here is more than 4
lines long.  As such, it violates one or more Usenet RFCs.  In order to remain in
compliance with said RFCs, the actual sig can be found at the following web address:
	http://www.xmission.com/~gazelle/Sigs/Seriously

[toc] | [prev] | [next] | [standalone]


#91386

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2016-07-31 04:01 -0700
Message-ID<f6172d6e-44ab-41c6-a6f3-047d8f849c1a@googlegroups.com>
In reply to#91382
On Saturday, July 30, 2016 at 10:15:52 PM UTC-4, Real Troll wrote:
> It is time to stop discussing religion...

FWIW, I do not discuss religion.  There are very few aspects of being a
born again Christian which are religious in nature.  The bulk of being
a Christian is maintaining a personal relationship with Jesus Christ.
It is similar to maintaining relationships with your family and friends,
just more important.

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#91457

FromDavid Brown <david.brown@hesbynett.no>
Date2016-08-01 10:01 +0200
Message-ID<nnmvkv$mp3$2@dont-email.me>
In reply to#91386
On 31/07/16 13:01, Rick C. Hodgin wrote:
> On Saturday, July 30, 2016 at 10:15:52 PM UTC-4, Real Troll wrote:
>> It is time to stop discussing religion...
> 
> FWIW, I do not discuss religion.  There are very few aspects of being a
> born again Christian which are religious in nature.  The bulk of being
> a Christian is maintaining a personal relationship with Jesus Christ.
> It is similar to maintaining relationships with your family and friends,
> just more important.

OK, stop discussing your relationships with your family and friends in
technical newsgroups.  There are plenty of other social medias for that
sort of thing.

[toc] | [prev] | [next] | [standalone]


#91458

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-08-01 09:18 +0100
Message-ID<nnn0ko$q20$2@dont-email.me>
In reply to#91457
On 01/08/16 09:01, David Brown wrote:
> On 31/07/16 13:01, Rick C. Hodgin wrote:
>> On Saturday, July 30, 2016 at 10:15:52 PM UTC-4, Real Troll wrote:
>>> It is time to stop discussing religion...
>>
>> FWIW, I do not discuss religion.  There are very few aspects of being a
>> born again Christian which are religious in nature.  The bulk of being
>> a Christian is maintaining a personal relationship with Jesus Christ.
>> It is similar to maintaining relationships with your family and friends,
>> just more important.
>
> OK, stop discussing your relationships with your family and friends in
> technical newsgroups.  There are plenty of other social medias for that
> sort of thing.

Agreed. And that goes for James, too. ;-)

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#91469

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2016-08-01 12:36 +0000
Message-ID<nnnfnm$c3d$1@news.xmission.com>
In reply to#91457
In article <nnmvkv$mp3$2@dont-email.me>,
David Brown  <david.brown@hesbynett.no> wrote:
>On 31/07/16 13:01, Rick C. Hodgin wrote:
>> On Saturday, July 30, 2016 at 10:15:52 PM UTC-4, Real Troll wrote:
>>> It is time to stop discussing religion...
>> 
>> FWIW, I do not discuss religion.  There are very few aspects of being a
>> born again Christian which are religious in nature.  The bulk of being
>> a Christian is maintaining a personal relationship with Jesus Christ.
>> It is similar to maintaining relationships with your family and friends,
>> just more important.
>
>OK, stop discussing your relationships with your family and friends in
>technical newsgroups.  There are plenty of other social medias for that
>sort of thing.

Of course, this is not really a technical newsgroup.

I find Rick's posts entirely in line with the general mileu of this group.

-- 
The randomly chosen signature file that would have appeared here is more than 4
lines long.  As such, it violates one or more Usenet RFCs.  In order to remain in
compliance with said RFCs, the actual sig can be found at the following web address:
	http://www.xmission.com/~gazelle/Sigs/Noam

[toc] | [prev] | [next] | [standalone]


#91471

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2016-08-01 05:55 -0700
Message-ID<61a62a5b-d1c4-4db5-b077-f17d22c51c97@googlegroups.com>
In reply to#91469
On Monday, August 1, 2016 at 1:36:14 PM UTC+1, Kenny McCormack wrote:
> 
> Of course, this is not really a technical newsgroup.
> 
> I find Rick's posts entirely in line with the general mileu of this group.
> 
Knots are an important mathematical subject. It's easy to see how a discussion
of how to represent knots with C structures could develop into a discussion
on knitting, possibly with knitting / crochet flames.
But a thread that began with rather than ended up with a defence of knitting
versus crochet wouldn't be topical, it clearly belongs on a knitting newsgroup.

[toc] | [prev] | [next] | [standalone]


#91473

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2016-08-01 06:12 -0700
Message-ID<ba19c961-1db1-445e-9d7a-a0dbf4dc63ba@googlegroups.com>
In reply to#91471
On Monday, August 1, 2016 at 8:56:01 AM UTC-4, Malcolm McLean wrote:
> On Monday, August 1, 2016 at 1:36:14 PM UTC+1, Kenny McCormack wrote:
> > 
> > Of course, this is not really a technical newsgroup.
> > 
> > I find Rick's posts entirely in line with the general mileu of this group.
> > 
> Knots are an important mathematical subject. It's easy to see how a discussion
> of how to represent knots with C structures could develop into a discussion
> on knitting, possibly with knitting / crochet flames.
> But a thread that began with rather than ended up with a defence of knitting
> versus crochet wouldn't be topical, it clearly belongs on a knitting newsgroup.

That is certainly true of knitting.  But you'll find out eventually,
Malcolm, that my pursuit of teaching people about Jesus Christ is,
most likely, woefully inadequate in its presence, and scarcely sufficient
in conveying any degree of true and utter importance in coming to this
knowledge.

All people die.  And unless people are forgiven by Jesus Christ, they
will enter into a conscious eternal lake of fire, never to return.

It is so important that I do this with all area of my life, and even
then ... did I really need to sleep in that day?  Could I have not been
running up and down the streets shouting so as to reach at least one
more soul?

-----
There are no more important things than coming to a saving knowledge of
Jesus Christ, Malcom.  No, not one.  And when we do, we need to put Him
first in our lives in all we do.  Bakers for Jesus Christ.  Journalists
for Jesus Christ.  Developers for Jesus Christ.  School teachers for Jesus
Christ.  Counsel members for Jesus Christ.  And so on.

Jesus is life.  He is truth.  He is everything we need, because we were
made by Him, in His universe, in Him image and likeness, and He is the
source of all things.  And it's not like a hoarding operation, but rather
all He has He gives to those who are His.

It is only the enemy of God, Satan, who teaches otherwise.  And that enemy
is pervasive in this world, leading even the whole world astray:

    http://biblehub.com/kjv/revelation/12-9.htm
    "And the great dragon was cast out, that old serpent, called the
     Devil, and Satan, //which//deceiveth//the//whole//world//: he was
     cast out into the earth, and his angels were cast out with him."

The Bible also says that he has weakened the nations:

    http://biblehub.com/kjv/isaiah/14-12.htm
    "How art thou fallen from heaven, O Lucifer, son of the morning!
     how art thou cut down to the ground, which didst weaken the nations!"

Jesus Christ sets all things right.  He is the solid bedrock foundation
that we need upon which to build all things, for only upon Him things
cannot fail.

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#91492

FromKeith Thompson <kst-u@mib.org>
Date2016-08-01 08:37 -0700
Message-ID<lneg685wlx.fsf@kst-u.example.com>
In reply to#91457
David Brown <david.brown@hesbynett.no> writes:
> On 31/07/16 13:01, Rick C. Hodgin wrote:
[snip]
> OK, stop discussing your relationships with your family and friends in
> technical newsgroups.  There are plenty of other social medias for that
> sort of thing.

David, do you really think Rick is going to listen to you *this time*?

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#91528

FromDavid Brown <david.brown@hesbynett.no>
Date2016-08-01 22:33 +0200
Message-ID<nnobmq$fam$1@dont-email.me>
In reply to#91492
On 01/08/16 17:37, Keith Thompson wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 31/07/16 13:01, Rick C. Hodgin wrote:
> [snip]
>> OK, stop discussing your relationships with your family and friends in
>> technical newsgroups.  There are plenty of other social medias for that
>> sort of thing.
>
> David, do you really think Rick is going to listen to you *this time*?
>

I think it is highly unlikely.  But at least it is a very slightly 
different tactic from usual - at therefore a very slight chance of 
success.  And another drop in the ocean is not going to make the ocean 
noticeably wetter - but it will keep Kenny happy :-)

Rick, as an alternative forum you might like to try 
sci.electronics.design.  In theory, it /is/ a technical discussion group 
(threads about electronics do turn up), but discussing relationships 
with family and friends, real or unreal, is quite acceptable.  So are 
discussions on politics, religion, evolution, and many other topics.

[toc] | [prev] | [next] | [standalone]


#91541

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2016-08-01 15:31 -0700
Message-ID<a5bb9b30-974a-4e02-8add-1ccadf5e11a7@googlegroups.com>
In reply to#91528
On Monday, August 1, 2016 at 4:33:38 PM UTC-4, David Brown wrote:
> Rick, as an alternative forum...

I continue to pray for you, David.  I care too much about your
eternal soul to cease.

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#91549

Fromfir <profesor.fir@gmail.com>
Date2016-08-01 18:30 -0700
Message-ID<fc3601cf-c181-43d0-ab2e-44db5c972564@googlegroups.com>
In reply to#91541
W dniu wtorek, 2 sierpnia 2016 00:31:45 UTC+2 użytkownik Rick C. Hodgin napisał:
> On Monday, August 1, 2016 at 4:33:38 PM UTC-4, David Brown wrote:
> > Rick, as an alternative forum...
> 
> I continue to pray for you, David.  I care too much about your
> eternal soul to cease.
> 
> Best regards,
> Rick C. Hodgin

damn i wasn not here for half a year or so and i see its all the time tehe same story

[toc] | [prev] | [next] | [standalone]


#91406

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2016-07-31 14:04 -0400
Message-ID<nnlek7$j31$1@dont-email.me>
In reply to#91382
On Saturday July 30 2016 23:00, in comp.lang.c, "Real Troll"
<real.troll@trolls.com> wrote:

> 
> 
> It is time to stop discussing religion and instead we should start
> serious discussion about C.  Lets start with something simple:
> 
> 1) This program does a very simple thing but it is amazing it can do
> this with ease:
> 
>> #pragma hdrstop
>> #pragma argsused
>>
>> #include <stdio.h>
>>
>> #ifdef _WIN32
>> #include <tchar.h>
>> #else
>>   typedef char _TCHAR;
>>   #define _tmain main
>> #endif
>>
>> int _tmain(int argc, _TCHAR* argv[])
>> {
>>     printf ("Hello, World");
>>     getch();

To paraphrase "The Princess Bride": "You keep using that function. I do not
think it means what you think it means."


>>     return 0;
>> }
> 
> 
> 
> 2) when you run this program, you will get a black screen like this:
> 
> <https://s31.postimg.org/ewov7f7uz/black_screen.png>
> 
> 3) We can now go and improve this program and expand it to do something
> valuable.
> 
> 4) I hope you all enjoyed this.
> 


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

[toc] | [prev] | [next] | [standalone]


#91416

FromReal Troll <real.troll@trolls.com>
Date2016-07-31 15:33 -0400
Message-ID<nnljur$1ivn$1@gioia.aioe.org>
In reply to#91382
The instructions to run and use the free C++ compiler from Embarcadero 
are as follows:

Installing and Using the Embarcadero C++ 10.1 ‘Berlin’ Compiler and
Command-line Tools
==================

How do I install the Embarcadero 10.1 Berlin Compiler and command-
line tools? This document takes a look at what's contained in the free
download and shows how you can start building programs.

Contents:
# Introduction and basic information
# Detailed information about the compiler, including a list of all included
   tools
# Resources
# Putting it all together - using the compiler
# Detailed installation instructions (check this if you’re having trouble)
# Final words
# Acknowledgements

Introduction
============

The Embarcadero 10.1 Berlin C++ compiler is a free, Clang-based compiler for
32-bit Windows. The download includes a number of other tools, as well 
as the
Dinkumware STL and headers and import libraries required to build both
command-line and GUI Windows applications.

You are welcome and encouraged to use the tools, including for learning 
C++ or
ensuring C++ code you maintain is compatible with this compiler.


Basic Information
-----------------
To install the Embarcadero C++ 10.1 Berlin Free Command-line Tools, simply
right-click on the downloaded zip file, click ‘Extract All…’ in the popup
menu, and choose all of the default options. You need to add the ‘bin’ 
folder
to your system path, and then the compiler can be used immediately. If 
you are
not sure how to do that, instructions are included at the end of this
document.

Use of the C++ 10.1 Berlin compiler assumes the user is comfortable working
within a console interface.

Typically, the user will run an application such as Notepad or Sublime 
Text to
actually write their program (an editor is not supplied with the compiler).
When the user wishes to compile source code, they save the file out as
"filename.cpp" and then use the command-line tools from the command 
prompt to
compile and create an executable.  Like so:
     bcc32c filename.cpp

The first argument is name of the compiler tool, and the second argument
contains the C++ source file.  This application will attempt to compile the
source code and will notify the user of any errors in the code. If no errors
are found it will create an executable. To display information regarding the
various switches, type
     bcc32c -h

There are a wide variety of switches. To get further information on any
switch, add that switch after the “-h”. For example, to get more information
on “-a” (set data alignment boundary), type
     bcc32c -h -a

Testing the compiler
--------------------
Open a console window:
     Start | Run...  (or click the search box in Windows 10)
     Type "cmd" into the field [Enter]

Create a directory or navigate to where you want to store your source, for
example:
     Type "cd"
     Type "mkdir MySource"
     cd Mysource
(Now in “c:\users\You\MySource” or similar depending on your version of
Windows.)

Create a new source file, for example:
     Type 'notepad hello.cpp' to edit in Windows Notepad. It will ask if you
     want to create a new file; click Yes.
     Paste or type the following code in the editor:
         #include <iostream>
         int main(void)
         {
             std::cout << "Hello world!" << std::endl;
             return 0;
         }
     Save the changes (File menu, Save, in Notepad).

Compile the program to create an executable:
     In the console window, type
         bcc32c hello.cpp

Finally, you can run the application you created. In the console window, 
type
     hello
(The output will appear below your last command line.)

Detailed information about the compiler and command-line tools
--------------------------------------------------------------

First, let's look at the directory structure. The root by default is called
BCC101. Under this directory you will find:
     Bin
     Include
     Lib
     Bin

Bin is short for binaries. Under this directory you will find all of the
command-line tools (as well as RTL dynamic libraries). There are a wide
variety of tools, many more than just the compiler and linker.

All tools are command-line; that is, they must be run from a command prompt.

Complete list of tools in \bin
------------------------------

bcc32c
This is the compiler itself. Use the -h option to see all options. See
http://docwiki.embarcadero.com/RADStudio/Berlin/en/BCC32C Compiler
     Configuration file
     The compiler also uses a configuration file, bcc32c.cfg. The files 
contain
     options that would otherwise be passed on the command line. The 
download
     contains a configuration file with default values that should work 
on your
     system.

cpp32c
This is a C++ preprocessor. It allows you to see
the initial operations performed on C or C++ files before they are compiled,
ie expansion of #includes and processing of #defines. See
http://docwiki.embarcadero.com/RADStudio/Berlin/en/CPP32.EXE,_the_C_Compiler_P
reprocessor

grep
A tool for searching text files (such as source code) for matching strings.
See
http://docwiki.embarcadero.com/RADStudio/Berlin/en/GREP.EXE,_the_text_search_u
tility

ilink32
The linker, which combines compiler-output object files into an
executable file. It is normally invoked by the compiler. See 
http://docwiki.em
barcadero.com/RADStudio/Berlin/en/ILINK32.EXE,_the_32-bit_Incremental_Linker

implib
This takes either a DLL or a module definition file as input, and creates an
import library (.lib). For more information, see
http://docwiki.embarcadero.com/RADStudio/Berlin/en/IMPLIB.EXE,_the_Import_Libr
ary_Tool_for_Win32
http://docwiki.embarcadero.com/RADStudio/Berlin/en/Linking_DLLs_(C++)

make
A tool used to run commands based on file dependencies, usually used to help
compile a project of many source files. See
http://docwiki.embarcadero.com/RADStudio/Berlin/en/MAKE.EXE

tdump
Displays a large amount of information about the structure of a .exe, 
.lib or
.obj file, including debug information, exports, and more. See
http://docwiki.embarcadero.com/RADStudio/Berlin/en/TDUMP.EXE,_the_File_Dumping_Utility

tlib
Manages libraries (.lib files) created from several object files (.obj.) You
can create a library from several .obj files, add or remove .obj files,
replace .obj files, etc. See
http://docwiki.embarcadero.com/RADStudio/Berlin/en/TLIB.E
XE,_the_Library_Manager

touch
Sets the last-modified date and time of one or more files to the current 
time
or a specified time. See
http://docwiki.embarcadero.com/RADStudio/Berlin/en/TOUCH.EXE

For general information about all command-line utilities, see
http://docwiki.embarcadero.com/RADStudio/Berlin/en/Command-
Line_Utilities_Index

Include
-------
This directory contains all of the header files for the RTL, the STL
(Dinkumware) and the Windows SDK.

lib\win32c
There are two subfolders, debug and release. These contain all of the static
and import library files and startup code modules for debug or release 
builds.

Resources
=========

Embarcadero has extensive help online in the ‘docwiki’ for the tools,
libraries, C++ itself, and the larger product this compiler is a small part
of, C++Builder. You can find it at
http://docwiki.embarcadero.com/RADStudio/Berlin/en/Main_Page

There is also a Google Plus community at
https://plus.google.com/communities/118315259185736124693

Embarcadero has regular blogs and articles on the Community site:
http://community.embarcadero.com/blogs and 
http://community.embarcadero.com/

A very wide range of blogs on the general RAD Studio family (including
C++Builder’s sister product, Delphi) can be found at 
https://www.beginend.net/

We also recommend http://www.cplusplus.com/ and http://cppreference.com/ as
excellent resources for learning C++.

This compiler is for Windows 32-bit only. If you would like to compile, 
debug
etc for Windows 64-bit, iOS, Android, or OSX in addition to Win32 (and
possibly even more platforms by the time you read this), you can find 
the full
compiler and IDE suite as part of C++Builder:
https://www.embarcadero.com/products/cbuilder

We specialise in cross-platform C++, where you can compile, debug and deploy
for many platforms using one IDE and one compiler framework. This 
includes UI
design - there is no need to create separate UIs in platform-specific
software; create it once (with per-platform tweaks using the multi-device
designer, including platform-native controls) and save yourself a lot of 
time.
We also have world-class database and enterprise services frameworks, 
and all
this can be used with the same source on all platforms. This greatly
accelerates your app development, and we’re very proud of it. We 
encourage you
to check it out at https://www.embarcadero.com/products/cbuilder

Okay, advertising over now. (But seriously, go have a look.)

Putting it all together
=======================

So, now that you are armed with all this information you are probably
wondering "How do I turn my source code into a program?" We will start with
the simplest case of a single source file, console program. Here is the 
source
code of a file called simple.cpp that I wrote in the text editor, Notepad:

     #include <stdio.h>
     int main(void)
     {
         printf("Output from running program");
         return 0;
     }

To build this into a program we only need to call the compiler and tell 
it the
filename of the C++ file to compile:
     bcc32c simple.cpp

The resulting program is called simple.exe and can be run by typing “simple”
at the command-line. You can change the output name by using the “-o” switch
and specifying a different filename.

Now, let's look at the case of a console program with two source modules.
simple.cpp will contain our entry point main and will call a function 
defined
in the other module, funcs.cpp. The first example was very simple, barely
worth calling C++, so this example includes a couple of C++11 features.

simple.cpp:
     #include "funcs.h"
     int main(void)
     {
         const std::string str = GetMessage();
         std::cout << str << std::endl;

         const int a = 4;
         PrintResult([=]() { return a + str.length(); });
     }

funcs.h:
     #include <string>
     #include <iostream>

     template <typename F>
     void PrintResult(F f) { std::cout << f() << std::endl; }
     std::string GetMessage();

and funcs.cpp:
     #include "funcs.h"

     std::string GetMessage()
     {
         return "Hello world.";
     }

To build this, simply add funcs.cpp to the previous compiler command-line as
such:
     bcc32c simple.cpp funcs.cpp

The output simple.exe file will be generated and you can run it from the
command line, where it will print a message.

So what happens if you have a bunch of different include and library
directories, or hundreds of source files? As you can imagine the 
command-line
for this would be huge. You have two choices: wrap up all of these commands
into a batch file, or write a makefile to use with the ‘make’ utility, which
is included in the bin folder.

You can also use CMake specifying the Borland makefile generator. Here is an
example batch script (.bat file):
     REM Make sure cmake.exe, bcc32c.exe and borland make.exe are in the 
Path
     @echo off
     mkdir build
     cd build
     cmake -G"Borland Makefiles" -DCMAKE_CXX_COMPILER="bcc32c.exe"
         -DCMAKE_C_COMPILER="bcc32c.exe" -DCMAKE_VERBOSE_MAKEFILE=1 ..
     make
     cd ..
     echo CMakeBCC: Results available in 'build' folder
When copy/pasting, make sure the “cmake -G…” line (with several -DCMAKE_ 
flags)
is all on one line.

Detailed Installation
=====================

If you’re having trouble installing, follow the instructions in this 
section.

Extracting the zip file
-----------------------

Unzip the downloaded file to any location. For example, it could be unzipped
to c:\BCC101\. Do this by right-clicking on the file in Explorer, selecting
“Extract To…” on the popup menu, and clicking Ok until it’s complete.
Configuring the system path The location of the compiler must be in your
system path.

Find the location where you unzipped the downloaded file. This should be a
folder with three subfolders (\bin, \include and \lib.) For example, if you
extracted to the c:\ drive you may have a folder ‘c:\BCC101\bin’. You can
extract the downloaded file to any location, and you can copy/paste the
location from Explorer by clicking in the path edit box and selecting the
text, then pressing Ctrl+C or right-clicking and choosing Copy.

Add a path reference to the Environment variables
-------------------------------------------------

Open the system properties:
     In Windows 7: Using the mouse, right-click on the "My Computer" 
icon (on
your desktop), and choose "Properties". In Windows 10: Open an Explorer
window. Using the mouse, right-click on “This PC” and choose “Properties”.
     Then, click on “Advanced system settings” in the left-side pane.
     Click on the "Advanced" tab.
     Click on the "Environment Variables..." button.
     Highlight the "Path" System variable (bottom). Click on the "Edit..."
     button.
     Add the path to the \bin folder:
         In Windows 7: Append the line with ";c:\BCC101\BIN;" (or your
         installation folder)
         In Windows 10: Click the “New” button, and enter “c:\BCC101\bin” in
         the text box that appears below the other items in the list. Press
         Enter.
     Click OK (in the "Edit System Variables" (Windows 7) or “Edit 
environment
     variables” (Windows 10) dialog)
     Click OK (in the "Environment Variables" window) and click OK (in the
     "System Properties" window)

Testing the compiler is in the system path
------------------------------------------

Open a console window:
     Start | Run... (or click the search box in Windows 10)
     Type "cmd" into the field [Enter] (or 'command', if 'cmd' is not found)

Now, in the console window, type the following:
     bcc32c
You should see text in the console,
     Embarcadero C++ 7.20 for Win32 Copyright (c) 2012-2016 Embarcadero
     Technologies, Inc.

If you do not, double-check that the system path settings point to the “bin”
folder where you extracted the download zip file.

Final words
===========

We hope you find these tools useful. Go forth and code!

Acknowledgements
================

This was based on a previous community article on the older Embarcadero
Developer Network (EDN) web site written by John Thomas, further modified by
Marco Cantù, further modified by David Millington.

[toc] | [prev] | [next] | [standalone]


#91552

FromJason Benjamin <hexusnexus@gmail.com>
Date2016-08-02 03:40 +0000
Message-ID<nnp4n3$m1a$1@news.albasani.net>
In reply to#91382
On Sun, 31 Jul 2016 00:00:00 -0300, Real Troll wrote:

> It is time to stop discussing religion and instead we should start
> serious discussion about C.  Lets start with something simple:
> 
> 1) This program does a very simple thing but it is amazing it can do
> this with ease:
> 
>> #pragma hdrstop #pragma argsused
>>
>> #include <stdio.h>
>>
>> #ifdef _WIN32 #include <tchar.h>
>> #else
>>   typedef char _TCHAR;
>>   #define _tmain main
>> #endif
>>
>> int _tmain(int argc, _TCHAR* argv[])
>> {
>>     printf ("Hello, World");
>>     getch();
>>     return 0;
>> }
> 
> 
> 
> 2) when you run this program, you will get a black screen like this:
> 
> <https://s31.postimg.org/ewov7f7uz/black_screen.png>
> 
> 3) We can now go and improve this program and expand it to do something
> valuable.
> 
> 4) I hope you all enjoyed this.

Not sure how this would go over at the Ch*** of Em..s though.  Reminds me 
of the start of some sort of login/password program just by looking at 
the code.



-- 
[The Computer] was the first machine man built that assisted the power of 
his brain instead of the strength of his arm. - Grace Hopper

[toc] | [prev] | [next] | [standalone]


#91553

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2016-08-01 21:44 -0600
Message-ID<1bd1lrrg1d.fsf@pfeifferfamily.net>
In reply to#91552
Jason Benjamin <hexusnexus@gmail.com> writes:

> On Sun, 31 Jul 2016 00:00:00 -0300, Real Troll wrote:
>
>> It is time to stop discussing religion and instead we should start
>> serious discussion about C.  Lets start with something simple:
>> 
>> 1) This program does a very simple thing but it is amazing it can do
>> this with ease:
>> 
>>> #pragma hdrstop #pragma argsused
>>>
>>> #include <stdio.h>
>>>
>>> #ifdef _WIN32 #include <tchar.h>
>>> #else
>>>   typedef char _TCHAR;
>>>   #define _tmain main
>>> #endif
>>>
>>> int _tmain(int argc, _TCHAR* argv[])
>>> {
>>>     printf ("Hello, World");
>>>     getch();
>>>     return 0;
>>> }
>> 
>> 
>> 
>> 2) when you run this program, you will get a black screen like this:
>> 
>> <https://s31.postimg.org/ewov7f7uz/black_screen.png>
>> 
>> 3) We can now go and improve this program and expand it to do something
>> valuable.
>> 
>> 4) I hope you all enjoyed this.
>
> Not sure how this would go over at the Ch*** of Em..s though.  Reminds me 
> of the start of some sort of login/password program just by looking at 
> the code.
>[The Computer] was the first machine man built that assisted the power of 
>his brain instead of the strength of his arm. - Grace Hopper

Much as I admire Admiral Hopper, did she really never encounter an
adding machine?  A slide rule?  An abacus?

[toc] | [prev] | [next] | [standalone]


#91554

FromReal Troll <real.troll@trolls.com>
Date2016-08-02 00:30 -0400
Message-ID<nnp723$m4d$1@gioia.aioe.org>
In reply to#91382
On 31/07/2016 04:00, Real Troll wrote:
>
>
> It is time to stop discussing religion and instead we should start 
> serious discussion about C.  Lets start with something simple:
>
>
> 4) I hope you all enjoyed this.
>

Initial test of creating an executable in Embarcadero C++ builder 
results in smaller code and faster run times.  VC seems to be slower.  I 
have used free version from Embarcadero and also the Starter Edition Berlin.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c


csiph-web