Op 6-sep.-2013 21:51 schreef "Incongruous" <[email protected]> het
volgende:
>
> Yes, I am using g++.
> __cplusplus is defined in stddef and I have specifically #include(ed)
that file.
> I hope that this new info will clear things.
> I know that you kids have a better understanding of C++ than me, so I
know that the answer to this issue lies in this mailing list.
> Thanks for the help.
The macro is not defined in any header, but predefined by the compiler. I
would suggest not doing a silly check for language and instead just choose
your language and stick to it. The only place that warrants this check is
in an interface header or if you're checking for C++11 by the value of this
macro.
As an aside (meant only as friendly advice), you might get more direct (not
always more friendly ;-)) answers about C++ questions at stackoverflow.com.
I also linger there. Note that your question as posed here, would have been
shot to bits as it misses several important things:
- A small compilable piece of code showing your issue.
- Your intent, i.e. the bigger picture, which often leads to removing the
problem altogether.
- The exact error message you get when trying to compile your code.
This will help everyone get faster and better solutions to people's
problems ;-)
Cheers,
Ruben
>
>
> From: Kai Tietz
> Sent: Friday, September 06, 2013 1:41 AM
> To: [email protected]
> Subject: Re: [Mingw-w64-public] #ifndef or #ifdef, that is the dilemma
>
>
> As you check for "__cpluplus" - which is obviously not defined by
compiler by default - I would assume you are using c++ :
> ;-)
>
>
>
>
> Am 05.09.2013 23:10 schrieb "Incongruous" <[email protected]>:
>>
>> #ifndef __cpluplus
>> std::cout << "error\n A C++ compiler is required!" << std::endl;
>> return -1;
>> #endif
>> The above snip says, if __cplusplus has not been defined print “bla
bla” and return –1. Which means that if I am using __cplusplus it should
NOT print anthing, right? So, am I using the C or the C++ compiler? I am
really confused.
>>
>> TIA
>>
>>
------------------------------------------------------------------------------
>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>> Discover the easy way to master current and previous Microsoft
technologies
>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>> tutorial videos with LearnDevNow. Subscribe today and save!
>>
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Mingw-w64-public mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
> ________________________________
>
------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft
technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
>
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
>
> ________________________________
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft
technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
>
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public