public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Gcc compiler b18 newbie probs
@ 1997-12-10 15:31 Earnie Boyd
  1997-12-10 18:19 ` c++ vs g++ [Re: Gcc compiler b18 newbie probs] Mumit Khan
  1997-12-11  2:23 ` Gcc compiler b18 newbie probs Fergus Henderson
  0 siblings, 2 replies; 7+ messages in thread
From: Earnie Boyd @ 1997-12-10 15:31 UTC (permalink / raw)
  To: khan; +Cc: gnu-win32

>To: Rich Dorfman <webhead@web-feats.com>
>Cc: gnu-win32@cygnus.com
>Subject: Re: Gcc compiler b18 newbie probs
>Date: Wed, 10 Dec 1997 09:40:38 -0600
>From: Mumit Khan <khan@xraylith.wisc.edu>
>
>Rule-of-thumb, especially for new users:
>  
>  - use the right compiler driver to compile/link programs. For C 
programs,
>    use gcc, for C++ use c++ and for F77 use g77.

                          ^^^ shouldn't this be g++

gcc will (or so it is documented to do so) determine if the code is C++.  
Also file extensions are used to determine C vs C++.  The cygwin gcc 
will compile a file named hello.c as C if you type

gcc -c hello.c

It will compile it as C++ if you type

gcc -c hello.C

hello.c and hello.C are the same file as the win32 filesystem is case 
insensitive when in comes to finding the file on disk.  However the 
command line case is kept intact so that gcc will operate differently on 
the file based on the lowercase .c or the UPPERCASE .C.


>
>There are cases where you need a different driver, but then you'd have 
to
>know what libraries need to be linked in explicitly and so on. Not 
worth
>the hassle for usual projects, but sometimes needed for multi-language
>projects, especially when mixing F77 and C/C++.
>
>Regards,
>Mumit -- khan@xraylith.wisc.edu
> http://www.xraylith.wisc.edu/~khan/
>-
>For help on using this list (especially unsubscribing), send a message 
to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>


-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd@hotmail.com-
------ooo0O--O0ooo-------


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* c++ vs g++ [Re: Gcc compiler b18 newbie probs]
  1997-12-10 15:31 Gcc compiler b18 newbie probs Earnie Boyd
@ 1997-12-10 18:19 ` Mumit Khan
  1997-12-11  2:23 ` Gcc compiler b18 newbie probs Fergus Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Mumit Khan @ 1997-12-10 18:19 UTC (permalink / raw)
  To: gnu-win32

"Earnie Boyd" <earnie_boyd@hotmail.com> writes:
> 
> >  - use the right compiler driver to compile/link programs. For C 
> programs,
> >    use gcc, for C++ use c++ and for F77 use g77.
> 
>                           ^^^ shouldn't this be g++
> 

Historically these two had a subtle difference: g++ implicitly linked
with libg++ while c++ did not. With egcs-1.00, they're equivalent; even
before the advent of egcs, I never considereed libg++ as a standard
package, and preferred not to use g++ as the C++ driver. I guess I
simply don't like unneeded libraried implicitly linked in that standard
conforming code(*) does not need.

I haven't checked the last FSF gcc-2.8.0 snapshot to check if the 
distinction is still there or not.

Mumit

* Now we can finally (almost) use the term "standard conforming" when 
talking about C++. What a relief.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Gcc compiler b18 newbie probs
  1997-12-10 15:31 Gcc compiler b18 newbie probs Earnie Boyd
  1997-12-10 18:19 ` c++ vs g++ [Re: Gcc compiler b18 newbie probs] Mumit Khan
@ 1997-12-11  2:23 ` Fergus Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Fergus Henderson @ 1997-12-11  2:23 UTC (permalink / raw)
  To: Cygnus GNU-win32 mailing list

Earnie Boyd <earnie_boyd@hotmail.com> wrote:
> 
> 
> >To: Rich Dorfman <webhead@web-feats.com>
> >Cc: gnu-win32@cygnus.com
> >Subject: Re: Gcc compiler b18 newbie probs
> >Date: Wed, 10 Dec 1997 09:40:38 -0600
> >From: Mumit Khan <khan@xraylith.wisc.edu>
> >
> >Rule-of-thumb, especially for new users:
> >  
> >  - use the right compiler driver to compile/link programs. For C 
> programs,
> >    use gcc, for C++ use c++ and for F77 use g77.
> 
>                           ^^^ shouldn't this be g++

Depends on what you want to link in.
`c++' just links in the standard C++ libraries, I think.
`g++' also links in libg++.

> gcc will (or so it is documented to do so) determine if the code is C++.  
> Also file extensions are used to determine C vs C++.  The cygwin gcc 
> will compile a file named hello.c as C if you type
> 
> gcc -c hello.c
> 
> It will compile it as C++ if you type
> 
> gcc -c hello.C

Yes, it will _compile_ it as C++, but if you do `gcc hello.C' it
will still _link_ it as if it were C (that is, it won't link in
the C++ libraries).

-- 
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: < http://www.cs.mu.oz.au/~fjh >   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c++ vs g++ [Re: Gcc compiler b18 newbie probs]
  1997-12-21  3:12 Alfredo Duran
@ 1997-12-21 15:33 ` Peter Dalgaard BSA
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Dalgaard BSA @ 1997-12-21 15:33 UTC (permalink / raw)
  To: Alfredo Duran; +Cc: gnu-win32, khan

Alfredo Duran <duran@cobra.vdl2.ca> writes:

> 
> 
> 

Well, for a man with nothing to say, you express yourself very
succinctly... ;)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c++ vs g++ [Re: Gcc compiler b18 newbie probs]
@ 1997-12-21  3:12 Alfredo Duran
  1997-12-21 15:33 ` Peter Dalgaard BSA
  0 siblings, 1 reply; 7+ messages in thread
From: Alfredo Duran @ 1997-12-21  3:12 UTC (permalink / raw)
  To: gnu-win32, khan

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c++ vs g++ [Re: Gcc compiler b18 newbie probs]
  1997-12-11  4:37 c++ vs g++ [Re: Gcc compiler b18 newbie probs] Earnie Boyd
@ 1997-12-11  7:48 ` Mumit Khan
  0 siblings, 0 replies; 7+ messages in thread
From: Mumit Khan @ 1997-12-11  7:48 UTC (permalink / raw)
  To: gnu-win32

"Earnie Boyd" <earnie_boyd@hotmail.com> writes:
> I didn't realize that the c++ option was available.  I believe however 
> that the c++.exe and g++.exe supplied from cygnus are the same file with 
> different names.  I base this on exec "cmp -c /bin/g++.exe /bin/c++.exe" 
> not returning anything.

On systems that support linking, they're the same file. On Win32, they're
copies. Until recently, the program would include the different libraries
depending on what name it was called with (g++ or c++), much like what
gzip and gunzip do.

with egcs, there is *no* difference between c++ and g++. Those who want to 
use libg++, should now use:
    
    % c++ -o blah.exe blah.o -lg++

Mumit
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c++ vs g++ [Re: Gcc compiler b18 newbie probs]
@ 1997-12-11  4:37 Earnie Boyd
  1997-12-11  7:48 ` Mumit Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Earnie Boyd @ 1997-12-11  4:37 UTC (permalink / raw)
  To: gnu-win32

Thanks Mumit,

I didn't realize that the c++ option was available.  I believe however 
that the c++.exe and g++.exe supplied from cygnus are the same file with 
different names.  I base this on exec "cmp -c /bin/g++.exe /bin/c++.exe" 
not returning anything.

-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd@hotmail.com-
------ooo0O--O0ooo-------

>To: gnu-win32@cygnus.com
>Subject: c++ vs g++ [Re: Gcc compiler b18 newbie probs]
>Date: Wed, 10 Dec 1997 20:19:15 -0600
>From: Mumit Khan <khan@xraylith.wisc.edu>
>
>"Earnie Boyd" <earnie_boyd@hotmail.com> writes:
>> 
>> >  - use the right compiler driver to compile/link programs. For C 
>> programs,
>> >    use gcc, for C++ use c++ and for F77 use g77.
>> 
>>                           ^^^ shouldn't this be g++
>> 
>
>Historically these two had a subtle difference: g++ implicitly linked
>with libg++ while c++ did not. With egcs-1.00, they're equivalent; even
>before the advent of egcs, I never considereed libg++ as a standard
>package, and preferred not to use g++ as the C++ driver. I guess I
>simply don't like unneeded libraried implicitly linked in that standard
>conforming code(*) does not need.
>
>I haven't checked the last FSF gcc-2.8.0 snapshot to check if the 
>distinction is still there or not.
>
>Mumit
>
>* Now we can finally (almost) use the term "standard conforming" when 
>talking about C++. What a relief.
>-
>For help on using this list (especially unsubscribing), send a message 
to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-12-21 15:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-10 15:31 Gcc compiler b18 newbie probs Earnie Boyd
1997-12-10 18:19 ` c++ vs g++ [Re: Gcc compiler b18 newbie probs] Mumit Khan
1997-12-11  2:23 ` Gcc compiler b18 newbie probs Fergus Henderson
1997-12-11  4:37 c++ vs g++ [Re: Gcc compiler b18 newbie probs] Earnie Boyd
1997-12-11  7:48 ` Mumit Khan
1997-12-21  3:12 Alfredo Duran
1997-12-21 15:33 ` Peter Dalgaard BSA

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 read-only IMAP folder(s) and NNTP newsgroup(s).