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


Groups > comp.lang.c++ > #11752 > unrolled thread

A free version of C++ on Win (7)??

Started by"W. eWatson" <wolftracks@invalid.com>
First post2011-11-23 09:42 -0800
Last post2011-11-25 21:24 +0800
Articles 20 on this page of 50 — 26 participants

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


Contents

  A free version of C++ on Win (7)?? "W. eWatson" <wolftracks@invalid.com> - 2011-11-23 09:42 -0800
    Re: A free version of C++ on Win (7)?? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-23 12:46 -0500
      Re: A free version of C++ on Win (7)?? "W. eWatson" <wolftracks@invalid.com> - 2011-11-23 10:37 -0800
        Re: A free version of C++ on Win (7)?? Ian Collins <ian-news@hotmail.com> - 2011-11-24 08:05 +1300
          Re: A free version of C++ on Win (7)?? "W. eWatson" <wolftracks@invalid.com> - 2011-11-24 07:10 -0800
    Re: A free version of C++ on Win (7)?? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-23 20:24 +0100
      Re: A free version of C++ on Win (7)?? Ebenezer <woodbrian77@gmail.com> - 2011-11-23 12:18 -0800
        Re: A free version of C++ on Win (7)?? Krice <paulkp@mbnet.fi> - 2011-11-25 01:34 -0800
          [OT] Re: A free version of C++ on Win (7)?? Paavo Helde <myfirstname@osa.pri.ee> - 2011-11-25 17:01 -0600
      Re: A free version of C++ on Win (7)?? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-24 01:59 -0800
        Re: A free version of C++ on Win (7)?? ralph <nt_consulting64@yahoo.net> - 2011-11-24 10:59 -0600
          Re: A free version of C++ on Win (7)?? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-25 00:40 -0800
            Re: A free version of C++ on Win (7)?? jacob navia <jacob@spamsink.net> - 2011-11-25 11:40 +0100
              Re: A free version of C++ on Win (7)?? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-27 02:47 -0800
              Re: A free version of C++ on Win (7)?? Thomas Boell <tboell@domain.invalid> - 2011-11-27 16:56 +0100
              Re: A free version of C++ on Win (7)?? Adrien Haxaire <nntp@adrienhaxaire.org> - 2011-12-06 10:48 +0100
            Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-26 00:30 +0000
              Re: A free version of C++ on Win (7)?? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-27 02:49 -0800
            Re: A free version of C++ on Win (7)?? Dombo <dombo@disposable.invalid> - 2011-11-27 22:39 +0100
          Re: A free version of C++ on Win (7)?? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-25 12:29 +0000
            Re: A free version of C++ on Win (7)?? ralph <nt_consulting64@yahoo.net> - 2011-11-25 22:38 -0600
    Re: A free version of C++ on Win (7)?? Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-23 21:27 +0100
    Re: A free version of C++ on Win (7)?? Lynn McGuire <lmc@winsim.com> - 2011-11-23 14:38 -0600
    Re: A free version of C++ on Win (7)?? puppi <fabricio.puppi@gmail.com> - 2011-11-23 17:40 -0800
      Re: A free version of C++ on Win (7)?? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-24 02:00 -0800
    Re: A free version of C++ on Win (7)?? XeCycle <xecycle@gmail.com> - 2011-11-24 12:05 +0800
    Re: A free version of C++ on Win (7)?? Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-24 20:38 +0100
    Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-25 03:14 +0000
      Re: A free version of C++ on Win (7)?? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-25 12:31 +0100
        Re: A free version of C++ on Win (7)?? Leigh Johnston <leigh@i42.co.uk> - 2011-11-25 14:37 +0000
        Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-26 00:38 +0000
          Re: A free version of C++ on Win (7)?? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-26 01:46 +0100
            Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-26 00:57 +0000
            Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-26 01:00 +0000
              Re: A free version of C++ on Win (7)?? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-26 02:08 +0100
                Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-26 02:32 +0000
                  Re: A free version of C++ on Win (7)?? Ian Collins <ian-news@hotmail.com> - 2011-11-26 15:47 +1300
                    Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-26 03:27 +0000
                      Re: A free version of C++ on Win (7)?? "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-26 11:00 +0100
                        [OT] A free version of C++ on Win (7)?? Leigh Johnston <leigh@i42.co.uk> - 2011-11-26 12:56 +0000
                          Re: [OT] A free version of C++ on Win (7)?? "Asger Joergensen" <Junk@Asger-P.dk> - 2011-11-26 13:46 +0000
                          Re: A free version of C++ on Win (7)?? Squeamizh <squeamz@hotmail.com> - 2011-11-26 08:50 -0800
                            Re: A free version of C++ on Win (7)?? gwowen <gwowen@gmail.com> - 2011-11-28 01:47 -0800
                  Re: A free version of C++ on Win (7)?? Tobias Müller <troplin@bluewin.ch> - 2011-11-26 12:46 +0000
              Re: A free version of C++ on Win (7)?? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-27 02:58 -0800
                Re: A free version of C++ on Win (7)?? legalize+jeeves@mail.xmission.com (Richard) - 2011-11-28 02:42 +0000
                  Re: A free version of C++ on Win (7)?? Paavo Helde <myfirstname@osa.pri.ee> - 2011-11-28 01:20 -0600
        Re: A free version of C++ on Win (7)?? Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-27 02:55 -0800
          Re: A free version of C++ on Win (7)?? Gert-Jan de Vos <gert-jan.de.vos@onsneteindhoven.nl> - 2011-11-27 07:05 -0800
    Re: A free version of C++ on Win (7)?? Man-wai Chang <toylet.toylet@gmail.com> - 2011-11-25 21:24 +0800

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#11844

Fromralph <nt_consulting64@yahoo.net>
Date2011-11-25 22:38 -0600
Message-ID<05q0d7d47c9r4ivv8eqr5e1nn4pjhqik1c@4ax.com>
In reply to#11814
On 25 Nov 2011 12:29:23 GMT, Jorgen Grahn <grahn+nntp@snipabacken.se>
wrote:

>On Thu, 2011-11-24, ralph wrote:
>> On Thu, 24 Nov 2011 01:59:06 -0800 (PST), Nick Keighley
>> <nick_keighley_nospam@hotmail.com> wrote:
>...
>>>I gave up on MingW as I difficulty persauding it to generate
>>>debuggable code. This may have been the Bloodshed IDE that was giving
>>>me gip. I found VS less painful and a nicer GUI.
>>
>> All open source is essentially a construction kit. Some damn nice
>> stuff out there, but it alls need to be stamped "DIY". <BG>
>
>On Windows perhaps that's true, but in any (free) Unix it's certainly
>not -- unless you think anything which isn't one big IDE is a
>DIY construction kit.
>

I intended to take exception to your comment - providing a enumeration
of the many efforts required and the dangers inherent in building a
robust development environment based on Open Source products. However,
the more I think about it - I agree with your opinion of my thoughts.
<g>

A single vendor IDE for any platform makes any collage of tools a
"construction kit", if only by definition.

-ralph

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


#11759

FromVincenzo Mercuri <vincenzo.mercuri@yahoo.it>
Date2011-11-23 21:27 +0100
Message-ID<q9KdnS4j_5ezylDTnZ2dnUVZ8vudnZ2d@giganews.com>
In reply to#11752
W. eWatson ha scritto:
> I'm using Win 7. In any case, is there a free version of C++ or Win?

Follow these steps to get the g++ 4.6.1 compiler on Windows:

1. Download the "mingw-get-inst-2011xxxx.exe" installer from:
    http://sourceforge.net/projects/mingw/files/latest/download?source=files
    this will let you choose which compiler (gcc/g++/gfortran) to install,
    (I recommend to get both gcc and g++). You can optionally choose
    to also get MSYS (which I also recommend, that's a Bourne shell command
    line interpreter for windows). Install the MinGW environment under the
    default path "C:\MinGW".

2. Download the CodeBlocks installer "codeblocks-10.05-setup.exe" from:
    http://www.codeblocks.org/downloads/binaries. Install CodeBlocks.

3. Configure Codeblocks to use the MinGW environment:
    Settings -> Compiler and debugger -> Global compiler settings ->
    -> Toolchain executables and then set "C:\MinGW" (without quotes) as
    the Compiler's installation directory.

Now you are done!

For 64bit executables check out this project: 
http://mingw-w64.sourceforge.net/

You won't be able to build 64bit applications under Visual C++ Express
either, in this case you need to download the SDK (it's free):
http://www.microsoft.com/download/en/details.aspx?id=8442
it includes the command line compiler for x64.

-- 
Vincenzo Mercuri | www.backbox.org

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


#11760

FromLynn McGuire <lmc@winsim.com>
Date2011-11-23 14:38 -0600
Message-ID<jajll2$jlj$1@dont-email.me>
In reply to#11752
On 11/23/2011 11:42 AM, W. eWatson wrote:
> I'm using Win 7. In any case, is there a free version of C++ or Win?

www.openwatcom.org has a free C++, C and F77 compiler
that supports producing DOS16, DOS32, Win16 and Win32
programs.  There is an IDE and a source code debugger
with DOS16, Win16 and Win32 interfaces.

Lynn

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


#11765

Frompuppi <fabricio.puppi@gmail.com>
Date2011-11-23 17:40 -0800
Message-ID<028c33cf-b50d-4540-a158-dd79a8bdcd34@q16g2000yqn.googlegroups.com>
In reply to#11752
On Nov 23, 3:42 pm, "W. eWatson" <wolftra...@invalid.com> wrote:
> I'm using Win 7. In any case, is there a free version of C++ or Win?

If you absolutely must develop for Windows for professional reasons,
using Windows-specific APIs, then please follow the above advices.
Otherwise there really isn't any reason why you should be using
Windows and not Linux, afterall...

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


#11776

FromNick Keighley <nick_keighley_nospam@hotmail.com>
Date2011-11-24 02:00 -0800
Message-ID<bf6b9dfd-d865-4270-809a-db4d290e18af@b19g2000yqj.googlegroups.com>
In reply to#11765
On Nov 24, 1:40 am, puppi <fabricio.pu...@gmail.com> wrote:
> On Nov 23, 3:42 pm, "W. eWatson" <wolftra...@invalid.com> wrote:
>
> > I'm using Win 7. In any case, is there a free version of C++ or Win?
>
> If you absolutely must develop for Windows for professional reasons,
> using Windows-specific APIs, then please follow the above advices.
> Otherwise there really isn't any reason why you should be using
> Windows and not Linux, afterall...

why not or is this just the stallman koolade talking?

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


#11766

FromXeCycle <xecycle@gmail.com>
Date2011-11-24 12:05 +0800
Message-ID<877h2qf9mq.fsf@gmail.com>
In reply to#11752
"W. eWatson" <wolftracks@invalid.com> writes:

> I'm using Win 7. In any case, is there a free version of C++ or Win?

Aside from Visual C++ Express, the Microsoft Windows SDK also
provides C++ compiler for free, but it's compiler only.

MinGW is a port of GCC to Windows, which is *real* free software.

-- 
Carl Lei (XeCycle)
Department of Physics, Shanghai Jiao Tong University
OpenPGP public key: 7795E591
Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591

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


#11799

FromVincenzo Mercuri <vincenzo.mercuri@yahoo.it>
Date2011-11-24 20:38 +0100
Message-ID<lbOdnRGcHMSAAFPTnZ2dnUVZ8mCdnZ2d@giganews.com>
In reply to#11752
W. eWatson ha scritto:
> I'm using Win 7. In any case, is there a free version of C++ or Win?

There is also a newer version of the Dev-C++ IDE, which now integrates
gcc/g++ 4.6.1 (MinGW): http://orwellengine.blogspot.com/

-- 
Vincenzo Mercuri | www.backbox.org

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


#11807

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2011-11-25 03:14 +0000
Message-ID<jan17i$rua$1@news.xmission.com>
In reply to#11752
[Please do not mail me a copy of your followup]

"W. eWatson" <wolftracks@invalid.com> spake the secret code
<jajbao$6jj$4@dont-email.me> thusly:

>I'm using Win 7. In any case, is there a free version of C++ or Win?

Get Visual C++ Express Edition.  It's free and has no limitations on
the code that you produce with it (i.e. you can develop commercial
products with it).

Using gcc or other *nix-derived compilers is fine *if* you never intend
to write programs that use the Win32 API or anything other than POSIX
style system interfaces.  Otherwise, its just too much pain and I'd
recommend using the Visual C++ Express Edition instead.

As for Visual C++ "tricking" you into using Windows specific items,
I'd say that's just disgruntled *nix fanboy sentiment talking.  It
isn't hard at all to write very portable code using Visual C++.  I
have done it for years.  If you don't know what's Windows or Visual
C++ specific in any project template, then read the docs on it.
Everything that is Windows/VC specific is documented as such.

As for the badness of "generated" code, Visual C++ simply recognizes
that each application type has some boilerplate that is the same from
project to project.  Writing a console application?  You're going to
need a main().  And so-on.  The project templates simply save you some
work by generating this boiler plate when you create the project.

There's nothing magic or evil about this code, you can edit it or
delete it to your heart's content.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

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


#11813

From"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>
Date2011-11-25 12:31 +0100
Message-ID<janu9v$1fg$1@dont-email.me>
In reply to#11807
On 25.11.2011 04:14, Richard wrote:
> [Please do not mail me a copy of your followup]

This is good advice in general.


> "W. eWatson"<wolftracks@invalid.com>  spake the secret code
> <jajbao$6jj$4@dont-email.me>  thusly:
>
>> I'm using Win 7. In any case, is there a free version of C++ or Win?
>
> Get Visual C++ Express Edition.  It's free and has no limitations on
> the code that you produce with it (i.e. you can develop commercial
> products with it).
>
> Using gcc or other *nix-derived compilers is fine *if* you never intend
> to write programs that use the Win32 API or anything other than POSIX
> style system interfaces.  Otherwise, its just too much pain and I'd
> recommend using the Visual C++ Express Edition instead.

Well that's highly misleading.

MinGW g++ supports ordinary API level programming, which covers most of 
the Windows API.

But in my experience g++ does not in general support the latest 
Microsoft "technologies", whether buzzword or useful. For example, there 
was a time when g++ did not support GDI+, which is/was a very useful new 
"technology" (essentially added graphics capabilities that had been 
lacking for about ten years or so). I think but I'm not sure that GDI+ 
support has been added to g++ now. Anyway, creating a g++ binding was 
quite laborious because Microsoft, unnecessarily, used Visual C++ 
compiler-specific features and really Bad Practices ,such as using min 
and max macros instead of the functions from <algorithm>, in their GDI+ 
headers. There are two possibilities: unbelievable incompetence, or 
intentional attempt to trap users in Microsoft land.


> As for Visual C++ "tricking" you into using Windows specific items,
> I'd say that's just disgruntled *nix fanboy sentiment talking.  It
> isn't hard at all to write very portable code using Visual C++.  I
> have done it for years.  If you don't know what's Windows or Visual
> C++ specific in any project template, then read the docs on it.
> Everything that is Windows/VC specific is documented as such.
>
> As for the badness of "generated" code, Visual C++ simply recognizes
> that each application type has some boilerplate that is the same from
> project to project.  Writing a console application?  You're going to
> need a main().  And so-on.  The project templates simply save you some
> work by generating this boiler plate when you create the project.
>
> There's nothing magic or evil about this code, you can edit it or
> delete it to your heart's content.

It's true that Visual C++ *enables* you to write standard code.

But sometimes you have to work really hard at it. Like, when it 
presumably with the best of intentions try to help you by rewriting your 
standard-compliant XHTML code to Microsoft-specific rubble. I remember 
how ironic this was when MS released Internet Explorer 7, I think it 
was, anyway the version after the long hiatus, the version with better 
support for standards. The MS web page about this new version was 
perfectly standard-conforming, which caused a lot of really impressed 
and positive commentary -- for about 8 hours, when they updated it, and 
the MS tools screwed it totally up forever...

When I wrote that novices should be aware of the (intentional or not) 
Visual Studio attempts to trap the user in the Microsoft world, I did 
not expect any discussion about that, because it is so well known and so 
obvious to anyone experienced. So I did not give any examples. But OK, 
now's the time.

Let's create a console project in Visual C++ Express 10.0.

We (you) are the teacher or lab assistant, providing instructions to a 
novice. You want to /avoid/ that the novice ends up with Visual Studio's 
automatically generated console program "starter code". Because that 
starter code is not only Microsoft specific but teaches extreme wrongness.

<code>
// first_program_ever.cpp : Defines the entry point for the console 
application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}

</code>

Here the comment at the top is wrong, it's not the "entry point" but 
rather the "startup function" (one of the most infamous Microsoft 
documentation bugs, still there as far as I know, describes the WinMain 
startup function signature as the signature of a program's entry point).

The "stdafx.h" header is not a standard header. It is a header used for 
Visual C++ precompiled header technology. Which changes the semantics 
such that *standard code* fails to compile, with baffling (to the 
novice) "end of file" error messages. There is no advantage to 
precompiled headers for a little console program, but lots of 
disadvantages, including the non-standard semantics. I.e., when we 
discount colossal incompetence as an explanation, it's an attempt to 
trap the user in Microsoft-land.

"_tmain" is not a standard startup function name. The standard name is 
"main". "_tmain" is in support of Windows 9x. Conceivably whoever 
maintained this just forgot about stopping to use that thing after 2001, 
when the Layer for Unicode was introduced to deal with the lack of 
Unicode support in Windows 9x. But would anyone really believe that they 
forgot about that for 10 years? I don't.

Similarly, "_TCHAR" in the argument list is non-standard, and is solely 
in support of Windows 9x.

Finally, the "return 0;" is unnecessary, but it is the only thing here 
that is not an attempt to unnecessarily trap the user in Microsoft land.

To avoid that entrapment, you have to provide step by step instructions 
like those below, ordering the novice to do things in an apparently (to 
the novice) needlessly and senselessly complicated way -- which as I see 
it, of course is by design, an attempt to trap in Microsoft world.

   Step 1.
   Run Visual C++ Express by clicking its icon.

In Windows 7 one way I can do this is by typing "visual" in the Start 
menu, and selecting the (on my machine) second choice.

   Step 2.
   Click "New Project", select Windows Console Project, fill in
   details

This can look like <url: http://i.imgur.com/4V1bE.png>.

   Step 3.
   Click OK in "New Project" and ***DO NOT*** click "Next" in the
   "Application Wizard" that pops up. Instead click "Application
   Settings". This can look like <url: http://i.imgur.com/9ifsE.png>.

   Step 4.
   In the "Application Settings" page, **FIRST** remove the tick
   mark in the "Precompiled Header" box. **THEN** place a tick mark
   in the "Empty Project" box. Doing this the opposite order won't
   work.

Now you might wonder, at version 10.0 of Visual Studio, as of 2011, is 
it likely that there is still such an idiotic bug in one of the most 
often used dialogs? Well yes, it is IMHO likely, that it is there *by 
design*. That Microsoft rather heavy-handed steers the user towards 
using "Precompiled header" at least, which changes the semantics of 
ordinary C++ code so that it is no longer standard conforming (wrt. 
header inclusion), but instead Microsoft specific, and for standard code 
yields baffling error messages about encountering end-of-file.

   Step 5.
   Click Finish, right click the Source folder in the project, and add
   an a new file (you can call it "main.cpp", or anything).

That's a pretty awkward procedure just to avoid the entrapments!

And so it goes, e.g. for COM programming where instead of associating 
classes with UUIDs via standard C++ traits or even just a macro namer 
thing, a non-standard language extension is used. This language 
extension serves no purpose in C, where it would just as well be done 
via macros, and in C++ it has no advantages compared to a traits class. 
It is solely a device to trap the user in Microsoft land.

And so on.

All of this *can* in principle be avoided, and that's what I wrote.

But it is very much necessary to be aware of it.


Cheers & hth.,

- Alf

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


#11821

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-11-25 14:37 +0000
Message-ID<-9mdnQdBO9u7NVLTnZ2dnUVZ8s-dnZ2d@giganews.com>
In reply to#11813
On 25/11/2011 11:31, Alf P. Steinbach wrote:
> On 25.11.2011 04:14, Richard wrote:
>> [Please do not mail me a copy of your followup]
>
> This is good advice in general.
>
>
>> "W. eWatson"<wolftracks@invalid.com> spake the secret code
>> <jajbao$6jj$4@dont-email.me> thusly:
>>
>>> I'm using Win 7. In any case, is there a free version of C++ or Win?
>>
>> Get Visual C++ Express Edition. It's free and has no limitations on
>> the code that you produce with it (i.e. you can develop commercial
>> products with it).
>>
>> Using gcc or other *nix-derived compilers is fine *if* you never intend
>> to write programs that use the Win32 API or anything other than POSIX
>> style system interfaces. Otherwise, its just too much pain and I'd
>> recommend using the Visual C++ Express Edition instead.
>
> Well that's highly misleading.
>
> MinGW g++ supports ordinary API level programming, which covers most of
> the Windows API.
>
> But in my experience g++ does not in general support the latest
> Microsoft "technologies", whether buzzword or useful. For example, there
> was a time when g++ did not support GDI+, which is/was a very useful new
> "technology" (essentially added graphics capabilities that had been
> lacking for about ten years or so). I think but I'm not sure that GDI+
> support has been added to g++ now. Anyway, creating a g++ binding was
> quite laborious because Microsoft, unnecessarily, used Visual C++
> compiler-specific features and really Bad Practices ,such as using min
> and max macros instead of the functions from <algorithm>, in their GDI+
> headers. There are two possibilities: unbelievable incompetence, or
> intentional attempt to trap users in Microsoft land.
>
>
>> As for Visual C++ "tricking" you into using Windows specific items,
>> I'd say that's just disgruntled *nix fanboy sentiment talking. It
>> isn't hard at all to write very portable code using Visual C++. I
>> have done it for years. If you don't know what's Windows or Visual
>> C++ specific in any project template, then read the docs on it.
>> Everything that is Windows/VC specific is documented as such.
>>
>> As for the badness of "generated" code, Visual C++ simply recognizes
>> that each application type has some boilerplate that is the same from
>> project to project. Writing a console application? You're going to
>> need a main(). And so-on. The project templates simply save you some
>> work by generating this boiler plate when you create the project.
>>
>> There's nothing magic or evil about this code, you can edit it or
>> delete it to your heart's content.
>
> It's true that Visual C++ *enables* you to write standard code.
>
> But sometimes you have to work really hard at it. Like, when it
> presumably with the best of intentions try to help you by rewriting your
> standard-compliant XHTML code to Microsoft-specific rubble. I remember
> how ironic this was when MS released Internet Explorer 7, I think it
> was, anyway the version after the long hiatus, the version with better
> support for standards. The MS web page about this new version was
> perfectly standard-conforming, which caused a lot of really impressed
> and positive commentary -- for about 8 hours, when they updated it, and
> the MS tools screwed it totally up forever...
>
> When I wrote that novices should be aware of the (intentional or not)
> Visual Studio attempts to trap the user in the Microsoft world, I did
> not expect any discussion about that, because it is so well known and so
> obvious to anyone experienced. So I did not give any examples. But OK,
> now's the time.
>
> Let's create a console project in Visual C++ Express 10.0.
>
> We (you) are the teacher or lab assistant, providing instructions to a
> novice. You want to /avoid/ that the novice ends up with Visual Studio's
> automatically generated console program "starter code". Because that
> starter code is not only Microsoft specific but teaches extreme wrongness.
>
> <code>
> // first_program_ever.cpp : Defines the entry point for the console
> application.
> //
>
> #include "stdafx.h"
>
>
> int _tmain(int argc, _TCHAR* argv[])
> {
> return 0;
> }
>
> </code>
>
> Here the comment at the top is wrong, it's not the "entry point" but
> rather the "startup function" (one of the most infamous Microsoft
> documentation bugs, still there as far as I know, describes the WinMain
> startup function signature as the signature of a program's entry point).
>
> The "stdafx.h" header is not a standard header. It is a header used for
> Visual C++ precompiled header technology. Which changes the semantics
> such that *standard code* fails to compile, with baffling (to the
> novice) "end of file" error messages. There is no advantage to
> precompiled headers for a little console program, but lots of
> disadvantages, including the non-standard semantics. I.e., when we
> discount colossal incompetence as an explanation, it's an attempt to
> trap the user in Microsoft-land.
>
> "_tmain" is not a standard startup function name. The standard name is
> "main". "_tmain" is in support of Windows 9x. Conceivably whoever
> maintained this just forgot about stopping to use that thing after 2001,
> when the Layer for Unicode was introduced to deal with the lack of
> Unicode support in Windows 9x. But would anyone really believe that they
> forgot about that for 10 years? I don't.
>
> Similarly, "_TCHAR" in the argument list is non-standard, and is solely
> in support of Windows 9x.
>
> Finally, the "return 0;" is unnecessary, but it is the only thing here
> that is not an attempt to unnecessarily trap the user in Microsoft land.
>
> To avoid that entrapment, you have to provide step by step instructions
> like those below, ordering the novice to do things in an apparently (to
> the novice) needlessly and senselessly complicated way -- which as I see
> it, of course is by design, an attempt to trap in Microsoft world.
>
> Step 1.
> Run Visual C++ Express by clicking its icon.
>
> In Windows 7 one way I can do this is by typing "visual" in the Start
> menu, and selecting the (on my machine) second choice.
>
> Step 2.
> Click "New Project", select Windows Console Project, fill in
> details
>
> This can look like <url: http://i.imgur.com/4V1bE.png>.
>
> Step 3.
> Click OK in "New Project" and ***DO NOT*** click "Next" in the
> "Application Wizard" that pops up. Instead click "Application
> Settings". This can look like <url: http://i.imgur.com/9ifsE.png>.
>
> Step 4.
> In the "Application Settings" page, **FIRST** remove the tick
> mark in the "Precompiled Header" box. **THEN** place a tick mark
> in the "Empty Project" box. Doing this the opposite order won't
> work.
>
> Now you might wonder, at version 10.0 of Visual Studio, as of 2011, is
> it likely that there is still such an idiotic bug in one of the most
> often used dialogs? Well yes, it is IMHO likely, that it is there *by
> design*. That Microsoft rather heavy-handed steers the user towards
> using "Precompiled header" at least, which changes the semantics of
> ordinary C++ code so that it is no longer standard conforming (wrt.
> header inclusion), but instead Microsoft specific, and for standard code
> yields baffling error messages about encountering end-of-file.
>
> Step 5.
> Click Finish, right click the Source folder in the project, and add
> an a new file (you can call it "main.cpp", or anything).
>
> That's a pretty awkward procedure just to avoid the entrapments!
>
> And so it goes, e.g. for COM programming where instead of associating
> classes with UUIDs via standard C++ traits or even just a macro namer
> thing, a non-standard language extension is used. This language
> extension serves no purpose in C, where it would just as well be done
> via macros, and in C++ it has no advantages compared to a traits class.
> It is solely a device to trap the user in Microsoft land.
>
> And so on.
>
> All of this *can* in principle be avoided, and that's what I wrote.
>
> But it is very much necessary to be aware of it.

More platform specific noise; take it elsewhere Alf.

/Leigh

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


#11833

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2011-11-26 00:38 +0000
Message-ID<japcdt$v6j$2@news.xmission.com>
In reply to#11813
[Please do not mail me a copy of your followup]

"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> spake the secret code
<janu9v$1fg$1@dont-email.me> thusly:

>On 25.11.2011 04:14, Richard wrote:
>> Using gcc or other *nix-derived compilers is fine *if* you never intend
>> to write programs that use the Win32 API or anything other than POSIX
>> style system interfaces.  Otherwise, its just too much pain and I'd
>> recommend using the Visual C++ Express Edition instead.
>
>Well that's highly misleading.
>
>MinGW g++ supports ordinary API level programming, which covers most of 
>the Windows API.

Based on the number of times I've seen people desperate for help in
getting MinGW working over the years, I don't see the point of trying
to use that and get it to work ("most" of the Windows API?), instead
of just using the free Visual C++ Express Edition and knowing its Just
Going To Work and you will have ALL of the Windows API guaranteed.

>It's true that Visual C++ *enables* you to write standard code.
>
>But sometimes you have to work really hard at it.  Like, when it 
>presumably with the best of intentions try to help you by rewriting your 
>standard-compliant XHTML code [...]

This has nothing to do with C++.

>[much whinging about _tmain, stdafx.h, etc.]

Like I said, all this stuff is documented.

The rest of your complaints are straw man arguments.

The question wasn't "what is the best way to TEACH STANDARD C++".
The question was: "Where can I get a free C++ compiler for Windows
programming?".

Visual C++ Express Edition is a perfectly usable answer to the
poster's question.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

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


#11834

From"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>
Date2011-11-26 01:46 +0100
Message-ID<japcso$e6e$1@dont-email.me>
In reply to#11833
On 26.11.2011 01:38, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> "Alf P. Steinbach"<alf.p.steinbach+usenet@gmail.com>  spake the secret code
> <janu9v$1fg$1@dont-email.me>  thusly:
>
>> On 25.11.2011 04:14, Richard wrote:
>>> Using gcc or other *nix-derived compilers is fine *if* you never intend
>>> to write programs that use the Win32 API or anything other than POSIX
>>> style system interfaces.  Otherwise, its just too much pain and I'd
>>> recommend using the Visual C++ Express Edition instead.
>>
>> Well that's highly misleading.
>>
>> MinGW g++ supports ordinary API level programming, which covers most of
>> the Windows API.
>
> Based on the number of times I've seen people desperate for help in
> getting MinGW working over the years, I don't see the point of trying
> to use that and get it to work ("most" of the Windows API?), instead
> of just using the free Visual C++ Express Edition and knowing its Just
> Going To Work and you will have ALL of the Windows API guaranteed.
>
>> It's true that Visual C++ *enables* you to write standard code.
>>
>> But sometimes you have to work really hard at it.  Like, when it
>> presumably with the best of intentions try to help you by rewriting your
>> standard-compliant XHTML code [...]
>
> This has nothing to do with C++.
>
>> [much whinging about _tmain, stdafx.h, etc.]
>
> Like I said, all this stuff is documented.
>
> The rest of your complaints are straw man arguments.
>
> The question wasn't "what is the best way to TEACH STANDARD C++".
> The question was: "Where can I get a free C++ compiler for Windows
> programming?".
>
> Visual C++ Express Edition is a perfectly usable answer to the
> poster's question.

I replied to your incorrect assertion that "As for Visual C++ "tricking" 
you into using Windows specific items, I'd say that's just disgruntled 
*nix fanboy sentiment talking.".

You now chose to snip that from the quotes.

And to also add a false assertion about what I was replying to.

That may be unsmart (not understanding the discussion), or dishonest.

Given your classification of me as a "'nix fanboy" I'd say it's unsmart.


Cheers & hth.,

- Alf

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


#11835

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2011-11-26 00:57 +0000
Message-ID<japdhv$2cs$1@news.xmission.com>
In reply to#11834
[Please do not mail me a copy of your followup]

"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> spake the secret code
<japcso$e6e$1@dont-email.me> thusly:

>I replied to your incorrect assertion that "As for Visual C++ "tricking" 
>you into using Windows specific items, I'd say that's just disgruntled 
>*nix fanboy sentiment talking.".

I'd say that statement is still accurate.

You digressed into a complaint about HTML and how the Wizard makes it hard
to TEACH standard C++, neither of which is "tricking" you into using items
that are specific to Windows.  As you yourself pointed out, simply say
generate empty project and type everything yourself.  This is not as huge
an impediment as you're making it out to be.  It's a couple mouse clicks.

Therefore I stand by my original statement.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

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


#11837

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2011-11-26 01:00 +0000
Message-ID<japdmk$2cs$2@news.xmission.com>
In reply to#11834
[Please do not mail me a copy of your followup]

Oh, and _tmain and TCHAR generate perfectly compliant standard C++
code when you compile for ANSI and not UNICODE builds.  That's the
whole POINT of TCHAR and the _txxx functions.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

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


#11839

From"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>
Date2011-11-26 02:08 +0100
Message-ID<jape72$kku$1@dont-email.me>
In reply to#11837
On 26.11.2011 02:00, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> Oh, and _tmain and TCHAR generate perfectly compliant standard C++
> code when you compile for ANSI and not UNICODE builds.

Right.

>  That's the
> whole POINT of TCHAR and the _txxx functions.

Wrong.

Cheers & hth.,

- Alf

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


#11841

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2011-11-26 02:32 +0000
Message-ID<japj4e$c0j$1@news.xmission.com>
In reply to#11839
[Please do not mail me a copy of your followup]

"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> spake the secret code
<jape72$kku$1@dont-email.me> thusly:

>On 26.11.2011 02:00, Richard wrote:
>>  That's the
>> whole POINT of TCHAR and the _txxx functions.
>
>Wrong.

*sigh*

The more you talk, the more you convince me you're just a *nix fanboy
with an axe to grind against MS.

The whole point of TCHAR and the _txxx macros/functions is to make
your code portable to either ANSI or UNICODE builds on Windows.  In
the case of _tmain in an ANSI build, it expands to standard C++
signature for main.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

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


#11842

FromIan Collins <ian-news@hotmail.com>
Date2011-11-26 15:47 +1300
Message-ID<9jb29bF4d0U11@mid.individual.net>
In reply to#11841
On 11/26/11 03:32 PM, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> "Alf P. Steinbach"<alf.p.steinbach+usenet@gmail.com>  spake the secret code
> <jape72$kku$1@dont-email.me>  thusly:
>
>> On 26.11.2011 02:00, Richard wrote:
>>>   That's the
>>> whole POINT of TCHAR and the _txxx functions.
>>
>> Wrong.
>
> *sigh*
>
> The more you talk, the more you convince me you're just a *nix fanboy
> with an axe to grind against MS.
>
> The whole point of TCHAR and the _txxx macros/functions is to make
> your code portable to either ANSI or UNICODE builds on Windows.  In
> the case of _tmain in an ANSI build, it expands to standard C++
> signature for main.

So the new definition of portable code is "portable to either ANSI or 
UNICODE builds on Windows"?

-- 
Ian Collins

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


#11843

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2011-11-26 03:27 +0000
Message-ID<japmbd$hqp$1@news.xmission.com>
In reply to#11842
[Please do not mail me a copy of your followup]

Ian Collins <ian-news@hotmail.com> spake the secret code
<9jb29bF4d0U11@mid.individual.net> thusly:

>On 11/26/11 03:32 PM, Richard wrote:
>> The whole point of TCHAR and the _txxx macros/functions is to make
>> your code portable to either ANSI or UNICODE builds on Windows.
>
>So the new definition of portable code is "portable to either ANSI or 
>UNICODE builds on Windows"?

Jesus dude, wtf.  If you just want to find things to harp on, there's
alt.flame.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

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


#11847

From"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>
Date2011-11-26 11:00 +0100
Message-ID<jaqdc2$rh9$1@dont-email.me>
In reply to#11843
On 26.11.2011 04:27, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> Ian Collins<ian-news@hotmail.com>  spake the secret code
> <9jb29bF4d0U11@mid.individual.net>  thusly:
>
>> On 11/26/11 03:32 PM, Richard wrote:
>>> The whole point of TCHAR and the _txxx macros/functions is to make
>>> your code portable to either ANSI or UNICODE builds on Windows.
>>
>> So the new definition of portable code is "portable to either ANSI or
>> UNICODE builds on Windows"?
>
> Jesus dude, wtf.  If you just want to find things to harp on, there's
> alt.flame.


Richard, all you're doing is trying to drown my earlier reply to you  -- 
  in noise.

In my experience g++ does not in general support the latest Microsoft 
"technologies", whether buzzword or useful. For example, there was a 
time when g++ did not support GDI+, which is/was a very useful new 
"technology" (essentially added graphics capabilities that had been 
lacking for about ten years or so). I think but I'm not sure that GDI+ 
support has been added to g++ now. Anyway, creating a g++ binding was 
quite laborious because Microsoft, unnecessarily, used Visual C++ 
compiler-specific features and really Bad Practices ,such as using min 
and max macros instead of the functions from <algorithm>, in their GDI+ 
headers. There are two possibilities: unbelievable incompetence, or 
intentional attempt to trap users in Microsoft land.

It's true that Visual C++ *enables* you to write standard code.

But sometimes you have to work really hard at it. Like, when it 
presumably with the best of intentions try to help you by rewriting your 
standard-compliant XHTML code to Microsoft-specific rubble. I remember 
how ironic this was when MS released Internet Explorer 7, I think it 
was, anyway the version after the long hiatus, the version with better 
support for standards. The MS web page about this new version was 
perfectly standard-conforming, which caused a lot of really impressed 
and positive commentary -- for about 8 hours, when they updated it, and 
the MS tools screwed it totally up forever...

When I wrote that novices should be aware of the (intentional or not) 
Visual Studio attempts to trap the user in the Microsoft world, I did 
not expect any discussion about that, because it is so well known and so 
obvious to anyone experienced. So I did not give any examples. But OK, 
now's the time.

Let's create a console project in Visual C++ Express 10.0.

We (you) are the teacher or lab assistant, providing instructions to a 
novice. You want to /avoid/ that the novice ends up with Visual Studio's 
automatically generated console program "starter code". Because that 
starter code is not only Microsoft specific but teaches extreme wrongness.

<code>
// first_program_ever.cpp : Defines the entry point for the console 
application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
     return 0;
}

</code>

Here the comment at the top is wrong, it's not the "entry point" but 
rather the "startup function" (one of the most infamous Microsoft 
documentation bugs, still there as far as I know, describes the WinMain 
startup function signature as the signature of a program's entry point).

The "stdafx.h" header is not a standard header. It is a header used for 
Visual C++ precompiled header technology. Which changes the semantics 
such that *standard code* fails to compile, with baffling (to the 
novice) "end of file" error messages. There is no advantage to 
precompiled headers for a little console program, but lots of 
disadvantages, including the non-standard semantics. I.e., when we 
discount colossal incompetence as an explanation, it's an attempt to 
trap the user in Microsoft-land.

"_tmain" is not a standard startup function name. The standard name is 
"main". "_tmain" is in support of Windows 9x. Conceivably whoever 
maintained this just forgot about stopping to use that thing after 2001, 
when the Layer for Unicode was introduced to deal with the lack of 
Unicode support in Windows 9x. But would anyone really believe that they 
forgot about that for 10 years? I don't.

Similarly, "_TCHAR" in the argument list is non-standard, and is solely 
in support of Windows 9x.

Finally, the "return 0;" is unnecessary, but it is the only thing here 
that is not an attempt to unnecessarily trap the user in Microsoft land.

To avoid that entrapment, you have to provide step by step instructions 
like those below, ordering the novice to do things in an apparently (to 
the novice) needlessly and senselessly complicated way -- which as I see 
it, of course is by design, an attempt to trap in Microsoft world.

   Step 1.
   Run Visual C++ Express by clicking its icon.

In Windows 7 one way I can do this is by typing "visual" in the Start 
menu, and selecting the (on my machine) second choice.

   Step 2.
   Click "New Project", select Windows Console Project, fill in
   details

This can look like <url: http://i.imgur.com/4V1bE.png>.

   Step 3.
   Click OK in "New Project" and ***DO NOT*** click "Next" in the
   "Application Wizard" that pops up. Instead click "Application
   Settings". This can look like <url: http://i.imgur.com/9ifsE.png>.

   Step 4.
   In the "Application Settings" page, **FIRST** remove the tick
   mark in the "Precompiled Header" box. **THEN** place a tick mark
   in the "Empty Project" box. Doing this the opposite order won't
   work.

Now you might wonder, at version 10.0 of Visual Studio, as of 2011, is 
it likely that there is still such an idiotic bug in one of the most 
often used dialogs? Well yes, it is IMHO likely, that it is there *by 
design*. That Microsoft rather heavy-handed steers the user towards 
using "Precompiled header" at least, which changes the semantics of 
ordinary C++ code so that it is no longer standard conforming (wrt. 
header inclusion), but instead Microsoft specific, and for standard code 
yields baffling error messages about encountering end-of-file.

   Step 5.
   Click Finish, right click the Source folder in the project, and add
   an a new file (you can call it "main.cpp", or anything).

That's a pretty awkward procedure just to avoid the entrapments!

And so it goes, e.g. for COM programming where instead of associating 
classes with UUIDs via standard C++ traits or even just a macro namer 
thing, a non-standard language extension is used. This language 
extension serves no purpose in C, where it would just as well be done 
via macros, and in C++ it has no advantages compared to a traits class. 
It is solely a device to trap the user in Microsoft land.

And so on.

All of this *can* in principle be avoided, and that's what I wrote.

But it is very much necessary to be aware of it.


Cheers & hth.,

- Alf

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


#11851 — [OT] A free version of C++ on Win (7)??

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-11-26 12:56 +0000
Subject[OT] A free version of C++ on Win (7)??
Message-ID<IuKdnSdMD726f03TnZ2dnUVZ8qCdnZ2d@giganews.com>
In reply to#11847
On 26/11/2011 10:00, Alf P. Steinbach wrote:
> On 26.11.2011 04:27, Richard wrote:
>> [Please do not mail me a copy of your followup]
>>
>> Ian Collins<ian-news@hotmail.com> spake the secret code
>> <9jb29bF4d0U11@mid.individual.net> thusly:
>>
>>> On 11/26/11 03:32 PM, Richard wrote:
>>>> The whole point of TCHAR and the _txxx macros/functions is to make
>>>> your code portable to either ANSI or UNICODE builds on Windows.
>>>
>>> So the new definition of portable code is "portable to either ANSI or
>>> UNICODE builds on Windows"?
>>
>> Jesus dude, wtf. If you just want to find things to harp on, there's
>> alt.flame.
>
>
> Richard, all you're doing is trying to drown my earlier reply to you --
> in noise.
>
> In my experience g++ does not in general support the latest Microsoft
> "technologies", whether buzzword or useful. For example, there was a
> time when g++ did not support GDI+, which is/was a very useful new
> "technology" (essentially added graphics capabilities that had been
> lacking for about ten years or so). I think but I'm not sure that GDI+
> support has been added to g++ now. Anyway, creating a g++ binding was
> quite laborious because Microsoft, unnecessarily, used Visual C++
> compiler-specific features and really Bad Practices ,such as using min
> and max macros instead of the functions from <algorithm>, in their GDI+
> headers. There are two possibilities: unbelievable incompetence, or
> intentional attempt to trap users in Microsoft land.
>
> It's true that Visual C++ *enables* you to write standard code.
>
> But sometimes you have to work really hard at it. Like, when it
> presumably with the best of intentions try to help you by rewriting your
> standard-compliant XHTML code to Microsoft-specific rubble. I remember
> how ironic this was when MS released Internet Explorer 7, I think it
> was, anyway the version after the long hiatus, the version with better
> support for standards. The MS web page about this new version was
> perfectly standard-conforming, which caused a lot of really impressed
> and positive commentary -- for about 8 hours, when they updated it, and
> the MS tools screwed it totally up forever...
>
> When I wrote that novices should be aware of the (intentional or not)
> Visual Studio attempts to trap the user in the Microsoft world, I did
> not expect any discussion about that, because it is so well known and so
> obvious to anyone experienced. So I did not give any examples. But OK,
> now's the time.
>
> Let's create a console project in Visual C++ Express 10.0.
>
> We (you) are the teacher or lab assistant, providing instructions to a
> novice. You want to /avoid/ that the novice ends up with Visual Studio's
> automatically generated console program "starter code". Because that
> starter code is not only Microsoft specific but teaches extreme wrongness.
>
> <code>
> // first_program_ever.cpp : Defines the entry point for the console
> application.
> //
>
> #include "stdafx.h"
>
>
> int _tmain(int argc, _TCHAR* argv[])
> {
> return 0;
> }
>
> </code>
>
> Here the comment at the top is wrong, it's not the "entry point" but
> rather the "startup function" (one of the most infamous Microsoft
> documentation bugs, still there as far as I know, describes the WinMain
> startup function signature as the signature of a program's entry point).
>
> The "stdafx.h" header is not a standard header. It is a header used for
> Visual C++ precompiled header technology. Which changes the semantics
> such that *standard code* fails to compile, with baffling (to the
> novice) "end of file" error messages. There is no advantage to
> precompiled headers for a little console program, but lots of
> disadvantages, including the non-standard semantics. I.e., when we
> discount colossal incompetence as an explanation, it's an attempt to
> trap the user in Microsoft-land.
>
> "_tmain" is not a standard startup function name. The standard name is
> "main". "_tmain" is in support of Windows 9x. Conceivably whoever
> maintained this just forgot about stopping to use that thing after 2001,
> when the Layer for Unicode was introduced to deal with the lack of
> Unicode support in Windows 9x. But would anyone really believe that they
> forgot about that for 10 years? I don't.
>
> Similarly, "_TCHAR" in the argument list is non-standard, and is solely
> in support of Windows 9x.
>
> Finally, the "return 0;" is unnecessary, but it is the only thing here
> that is not an attempt to unnecessarily trap the user in Microsoft land.
>
> To avoid that entrapment, you have to provide step by step instructions
> like those below, ordering the novice to do things in an apparently (to
> the novice) needlessly and senselessly complicated way -- which as I see
> it, of course is by design, an attempt to trap in Microsoft world.
>
> Step 1.
> Run Visual C++ Express by clicking its icon.
>
> In Windows 7 one way I can do this is by typing "visual" in the Start
> menu, and selecting the (on my machine) second choice.
>
> Step 2.
> Click "New Project", select Windows Console Project, fill in
> details
>
> This can look like <url: http://i.imgur.com/4V1bE.png>.
>
> Step 3.
> Click OK in "New Project" and ***DO NOT*** click "Next" in the
> "Application Wizard" that pops up. Instead click "Application
> Settings". This can look like <url: http://i.imgur.com/9ifsE.png>.
>
> Step 4.
> In the "Application Settings" page, **FIRST** remove the tick
> mark in the "Precompiled Header" box. **THEN** place a tick mark
> in the "Empty Project" box. Doing this the opposite order won't
> work.
>
> Now you might wonder, at version 10.0 of Visual Studio, as of 2011, is
> it likely that there is still such an idiotic bug in one of the most
> often used dialogs? Well yes, it is IMHO likely, that it is there *by
> design*. That Microsoft rather heavy-handed steers the user towards
> using "Precompiled header" at least, which changes the semantics of
> ordinary C++ code so that it is no longer standard conforming (wrt.
> header inclusion), but instead Microsoft specific, and for standard code
> yields baffling error messages about encountering end-of-file.
>
> Step 5.
> Click Finish, right click the Source folder in the project, and add
> an a new file (you can call it "main.cpp", or anything).
>
> That's a pretty awkward procedure just to avoid the entrapments!
>
> And so it goes, e.g. for COM programming where instead of associating
> classes with UUIDs via standard C++ traits or even just a macro namer
> thing, a non-standard language extension is used. This language
> extension serves no purpose in C, where it would just as well be done
> via macros, and in C++ it has no advantages compared to a traits class.
> It is solely a device to trap the user in Microsoft land.
>
> And so on.
>
> All of this *can* in principle be avoided, and that's what I wrote.
>
> But it is very much necessary to be aware of it.

Alf you are not just a troll; you are a spam troll as you have now 
posted the same off-topic platform specific dross twice in two days. 
TAKE IT ELSEWHERE.

/Leigh

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


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

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


csiph-web