Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!wieslauf.sub.de!.POSTED!reversiblemaps.ath.cx!not-for-mail From: Jasen Betts Newsgroups: comp.os.linux.development.apps Subject: Re: Compilation order Date: 29 May 2011 12:48:13 GMT Organization: Dis (not Dat) Organisation Lines: 16 Message-ID: References: NNTP-Posting-Host: zEYMSs2ZX/47dxV7yCzc8A.user.wieslauf.sub.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@wieslauf.sub.de NNTP-Posting-Date: Sun, 29 May 2011 13:00:38 +0000 (UTC) User-Agent: slrn/pre1.0.0-18 (Linux) X-Notice: Filtered by postfilter v. 0.8.1 X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s;a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W;(T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q;8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^ Cancel-Lock: sha1:jBgnf1j8HrqFV6K4TaLNd+5xGeM= Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:126 On 2011-05-27, 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. dunno, try compiling with all the warnings turned on. -- ⚂⚃ 100% natural