Mega Search
23.2 Million


Sign Up

Make a donation  
RadStudio 2007 dislikes #include  
News Group: borland.public.cppbuilder.language.cpp

All,

I have just upgraded from BCB5 to RAD Studio 2007 and am beginning to
convert applications.  For a relatively simple VCL app, I have set up
a new project (conversion produced a nonworking result) and tried to
build the project, in the end successfully.

The main problem was that in sequences like the following,


   #include 
   #include 
   #include 
   #include 

   using namespace std ;


CB2007 did not like math, stdio, and stdlib.  To my knowledge of the
C++ standard, these commands should successfully include cstring.h,
math.h, stdio.h and stdlib.h.  All of these are existing where you
would expect them in CB2007's area.  BCB5 found them just as expected
(in its own area, not in CB2007's area, of course).

There was no entry for PATHs under "Compiler" but the global one is
present.  Copying it to the compiler specific setting did not change
anything.

At the time, there was a big fuss about writing 

   #include 

instead of

   #include 

Did I miss a change/reversion in the standard?

Cheers,                Jochen

hjtrost at microfab dot com


Nil nimium studeo, Caesar, tibi velle placere,
nec scire ut an sis albus an ater homo.
                                          Catullus

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 31-Dec-2007, at 12:18 PM EST
From: Hans-Jochen Trost
 
Re: RadStudio 2007 dislikes #include  
News Group: borland.public.cppbuilder.language.cpp
Thanks guys, I'm up and running.

Cheers,             Jochen
hjtrost at microfab dot com


Nil nimium studeo, Caesar, tibi velle placere,
nec scire ut an sis albus an ater homo.
                                          Catullus

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 4-Jan-2008, at 7:41 PM EST
From: Hans-Jochen Trost
 
Re: RadStudio 2007 dislikes #include  
News Group: borland.public.cppbuilder.language.cpp
"Hans-Jochen Trost"  wrote in message
news:aqbin3hdgkibnfiqbt2f38vhl51u29u3mq@4ax.com...

>    #include 
>    #include 
>    #include 

Those are not valid includes.  You need to either:

1) prefix them with 'c':

    #include 
    #include 
    #include 

2) add the .h file extension:

    #include 
    #include 
    #include 

>    using namespace std ;

You should generally stay away from doing that.  All you are really doing is
poluting the global namespace, defeating the whole purpose of using
namespaces in the first place.

> CB2007 did not like math, stdio, and stdlib.

No compile would.

> To my knowledge of the C++ standard, these commands
> should successfully include cstring.h, math.h, stdio.h and stdlib.h.

Then your understanding is not correct.  You need the 'c' prefix is for, as
shown above.

> All of these are existing where you would expect them in CB2007's
> area.  BCB5 found them just as expected

Then BCB5 was wrong, and you should not have expected it in the first place.


Gambit



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 1-Jan-2008, at 7:28 PM EST
From: Remy Lebeau \(TeamB\)
 
Re: RadStudio 2007 dislikes #include  
News Group: borland.public.cppbuilder.language.cpp
Hans-Jochen Trost  wrote:

>The main problem was that in sequences like the following,
>
>
>   #include 

Should be cstring, or string.h ... ah, success!

>   #include 

Should be cmath, or math.h

>   #include 

Should be cstdio, or stdio.h

>   #include 

Should be cstdlib, or stdlib.h

>   using namespace std ;

>CB2007 did not like math, stdio, and stdlib.  To my knowledge of the
>C++ standard, these commands should successfully include cstring.h,

No, string.h

>math.h, stdio.h and stdlib.h.  All of these are existing where you
>would expect them in CB2007's area. 

Your understanding of the C++ Standard is incorrect. All the C standard
headers have the form xxx.h, and may be included in that form, or in C++
as cxxx to have the declarations appear in std namespace rather than the
global namespace

Note that BCB5 had interesting quirks in the handling of standard
headers, which caused your non-standard includes to work.

Alan Bellingham
-- 
Team Browns
 Borland newsgroup descriptions
      netiquette

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 31-Dec-2007, at 6:32 PM EST
From: Alan Bellingham