Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #127

Re: Compilation order

Date 2011-05-30 08:56 +0200
From David Brown <david@westcontrol.removethisbit.com>
Newsgroups comp.os.linux.development.apps
Subject Re: Compilation order
References <ab6994bc-8b2d-4e9f-8f6c-f756ae1c3fa3@h36g2000pro.googlegroups.com> <NK-dnTy_nOtk1kLQnZ2dnUVZ8kmdnZ2d@lyse.net> <87zkm81d99.fsf@sapphire.mobileactivedefense.com>
Message-ID <_YWdnTaLkukyon7QnZ2dnUVZ8g-dnZ2d@lyse.net> (permalink)

Show all headers | View raw


On 27/05/2011 15:31, Rainer Weikusat wrote:
> David Brown<david@westcontrol.removethisbit.com>  writes:
>> On 27/05/2011 08:06, wij@seed.net.tw wrote:
>>> Hi:
>>> I have a program to update on Fedora 15(g++ version 4.6.0), but
>>> the compiled executable is wrong. Let me make an example. I had
>>> 2 files t1.cpp t2.cpp, t1 contains the main function. If I issue
>>> command "g++ t1.cpp t2.o". A static array in t2.o is not initialized.
>>> The command "g++ t2.o t1.cpp" solves the problem. But on earlier
>>> versions of g++, the same problem happened. In all, with g++ 4.6.0
>>> I should use g++ t2.o t1.cpp, with earlier versions I should use
>>> g++ t1.cpp t2.o. What is the problem and how should I fix it?
>>> Thanks in advance.
>>
>> Don't call g++ directly - always use "gcc", and let it call the
>> required linker or compiler programs as needed.
>
> That's wrong. g++ is the name of the gcc frontend for C++ and it is
> supposed to provide default values that 'work' for this language. It
> is not one of the backends (that would be cc1plus in this case).

Thanks (also to Richard) for correcting me here - I had, as you probably 
suspected, thought g++ was part of the backend rather than the front-end 
here.

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Compilation order wij@seed.net.tw - 2011-05-26 23:06 -0700
  Re: Compilation order David Brown <david@westcontrol.removethisbit.com> - 2011-05-27 09:00 +0200
    Re: Compilation order Richard Kettlewell <rjk@greenend.org.uk> - 2011-05-27 09:59 +0100
    Re: Compilation order wij@seed.net.tw - 2011-05-27 05:56 -0700
      Re: Compilation order Richard Kettlewell <rjk@greenend.org.uk> - 2011-05-27 14:11 +0100
      Re: Compilation order David Schwartz <davids@webmaster.com> - 2011-05-27 12:23 -0700
        Re: Compilation order wij@seed.net.tw - 2011-05-27 18:56 -0700
          Re: Compilation order David Schwartz <davids@webmaster.com> - 2011-05-27 22:52 -0700
            Re: Compilation order wij@seed.net.tw - 2011-05-28 08:46 -0700
              Re: Compilation order David Schwartz <davids@webmaster.com> - 2011-06-03 04:30 -0700
    Re: Compilation order Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-05-27 14:31 +0100
      Re: Compilation order David Brown <david@westcontrol.removethisbit.com> - 2011-05-30 08:56 +0200
  Re: Compilation order Sergei Organov <osv@javad.com> - 2011-05-27 11:37 +0400
    Re: Compilation order Richard Kettlewell <rjk@greenend.org.uk> - 2011-05-27 10:00 +0100
  Re: Compilation order Jasen Betts <jasen@xnet.co.nz> - 2011-05-29 12:48 +0000

csiph-web