X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_YG X-Spam-Check-By: sourceware.org Message-ID: <50C9D639.4060907@gmail.com> Date: Thu, 13 Dec 2012 14:20:57 +0100 From: marco atzeri User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: A linking problem with current GCC (4.5.3) References: <50C8FC24 DOT 6000308 AT alice DOT it> In-Reply-To: <50C8FC24.6000308@alice.it> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 12/12/2012 10:50 PM, Angelo Graziosi wrote: > When Cygwin had GCC-4.3.4 as GCC default compiler, I could compile an > application with these steps > > > g++ -c winbgim.cpp -o winbgim-g95.o > > g95 -O3 -Wall -mwindows basic_mods.f90 f03bgi.f90 f03eyes.f90 \ > winbgim-g95bis.o -L /lib/gcc/i686-pc-cygwin/4.5.3 -lstdc++ \ > -s -o f03eyes-g95 > > > Now, with GCC 4.5.3, I see linker errors: > > > g++ -c winbgim.cpp -o winbgim-g95.o > > g95 -O3 -Wall -mwindows basic_mods.f90 f03bgi.f90 f03eyes.f90 \ > winbgim-g95.o -L /lib/gcc/i686-pc-cygwin/4.5.3 -lstdc++ \ > -s -o f03eyes-g95 > /lib///libcygwin.a(_cygwin_crt0_common.o):_cygwin_crt0_common.cc:(.data+0x4): > undefined reference to `__real__Znaj' > /lib///libcygwin.a(_cygwin_crt0_common.o):_cygwin_crt0_common.cc:(.data+0xc): > undefined reference to `__real__ZdaPv' > > > (Notice that I have used the right PATH /lib/gcc/i686-pc-cygwin/4.5.3...) > > But if I compile winbgim.cpp with g++-3, > > g++-3 -c winbgim.cpp -o winbgim-g95.o > > g95 -O3 -Wall -mwindows basic_mods.f90 f03bgi.f90 f03eyes.f90 \ > winbgim-g95.o -L /lib/gcc/i686-pc-cygwin/4.5.3 -lstdc++ \ > -s -o f03eyes-g95 > > it works! It also works if I use an old winbgim-g95.o compiled with > gcc-4.3.4... are you mixing compilers ? what is g95 pointing to ? $ cygcheck -c -d |grep gcc4 gcc4 4.5.3-3 gcc4-core 4.5.3-3 gcc4-fortran 4.5.3-3 gcc4-g++ 4.5.3-3 gcc4-java 4.5.3-3 $ which g95 which: no g95 in (/home/marco/bin:/usr/local/bin:/usr/bin:/usr/lib/lapack.. the fortran compiler should be gfortran > > > It seems I need to add some other library to command line... > eventually the orded > > Ciao, > Angelo. > Marco -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple