Mail Archives: djgpp/2004/05/08/12:30:14
fn Sat, 08 May 2004 15:15:58 GMT in comp.os.msdos.djgpp, CBFalconer
<cbfalconer AT yahoo DOT com> wrote:
>wordsworth wrote:
>> "Tom" <Thomas8675309 AT yahoo DOT com> wrote in message
>>> Martin Stromberg wrote:
>>>> wordsworth <news AT callera DOT net> wrote:
>>>
>>>>> I have now tried gpp that compiles my prog. So what is the
>>>>> difference between gcc and gpp
>>>>
>>>> gpp is the C++ compiler and gcc is the C compiler.
>>>
>>> gcc calls either the C compiler or the C++ compiler (or other
>>> programs) depending upon the file suffix of the file provided
>>> on the command line. gpp is the same as gcc (I believe) but
>>> links in the C++ standard library by default, while gcc
>>> requires that the library be expressly listed on the command
>>> line to link it in. So using gcc on a C++ source file will
>>> call the C++ compiler but fail to link in the C++ standard
>>> library unless you explicitly tell gcc to do so. Which is
>>> why using gcc on C++ source files can lead to linker errors.
>>>
>>> (And yes, I recognize that Martin knows the difference and
>>> was simplifying to make it easier for new users.)
>>
>> Thats almost cleared up this for me.
>>
>> Thank you both for your explaination (very helpful); question?
>> The C++ standard library is linked by default with gpp. How
>> does this manifest itself - I dont mean where is the C++
>> library, but rather how is it linked? Is it compiled into a
>> binary or can I define its location (add config switches) in a
>> config file? Basically I should think that the linker error
>> can be amended. I want to avoid having to add extra suff to
>> the compiler line when excuting cmd line compiles e.g. gpp
>> test.cc -o test.exe.
>
>Please don't top-post, it makes the posts incomprehensible. I
>fixed this one.
>
>Isn't there some fundamental misunderstanding going on here? gpp
>is the preprocessor. g++ is the C++ linking compiler. gxx is used
>under djgpp to replace g++ because the '+' is not valid in a DOS
>file name.
>
>If you don't link to a final executable you can use either gcc or
>gxx.
Recent versions of GCC use cpp instead of gpp and gpp instead of gxx.
--
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
Brian DOT Inglis AT CSi DOT com (Brian dot Inglis at SystematicSw dot ab dot ca)
fake address use address above to reply
- Raw text -