linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Markus Rechberger" <mrechberger@gmail.com>
To: B S Srinidhi <srinidhi-c@deeproot.co.in>
Cc: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Re: Compile error caused by case of filename extension
Date: Tue, 28 Mar 2006 08:26:01 +0200	[thread overview]
Message-ID: <d9def9db0603272226n2ffe9584w5accc39647ca9833@mail.gmail.com> (raw)
In-Reply-To: <1143275731.18472.44.camel@avirat>

Hi,

don't use void main() functions.. use int main instead.
The c++ standard defines the return value of main being int, though
compiler also support void.
In general int should be better since other applications could check
for the return value if the application exited successfully or not..

Markus

On 3/25/06, B S Srinidhi <srinidhi-c@deeproot.co.in> wrote:
> Hi,
>
> On Sat, 2006-03-25 at 13:33 +0530, Shriramana Sharma wrote:
> [..]
> > $ gcc -o TESTING TESTING.C
> > /tmp/ccEnQk4o.o:(.eh_frame+0x11): undefined reference to
> > `__gxx_personality_v0'
> > collect2: ld returned 1 exit status
> >
> > But if I change the input file name extension to testing.c or even TESTING.c
> > (small letters) no problems were got. Why is this?
> >
>
> >From the man page of gcc(1):
>
> file.cc
> file.cp
> file.cxx
> file.cpp
> file.CPP
> file.c++
> file.C
>     C++ source code which must be preprocessed. Note that in .cxx, the
> last two letters must both be literally x.  Likewise, .C refers to a
> literal capital C.
>
> That means, gcc will consider a source file with name TESTING.C to be a
> C++ source code. Thus trying to include / link with some special
> libraries.
>
> To compile your TESTING.C, use something like:
>
> $ g++ -o TESTING TESTING.C
>
> It 'll compile correctly.
>
> Hope this helps.
>
> Srinidhi.
> --
> ASCII ribbon campaign ( )         B S Srinidhi
>  - against HTML email  X          http://srinidhi.deeproot.co.in
>              & vCards / \         DeepRoot Linux
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


--
Markus Rechberger

      reply	other threads:[~2006-03-28  6:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25  8:03 Compile error caused by case of filename extension Shriramana Sharma
2006-03-25  8:35 ` B S Srinidhi
2006-03-28  6:26   ` Markus Rechberger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9def9db0603272226n2ffe9584w5accc39647ca9833@mail.gmail.com \
    --to=mrechberger@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=srinidhi-c@deeproot.co.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).