This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: A linking problem with current GCC (4.5.3)
- From: VÃclav Zeman <vhaisman at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 13 Dec 2012 14:08:37 +0100
- Subject: Re: A linking problem with current GCC (4.5.3)
- References: <50C8FC24.6000308@alice.it>
On 12 December 2012 22:50, 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...
>
>
> It seems I need to add some other library to command line...
If you are targeting native Windows (no Cygwin) then you can use
i686-w64-mingw32-gfortran and i686-w64-mingw32-g++ as replacements for
g++ and g95 commands. You will have to install the appropriate MinGW
related packages, though.
--
VZ
--
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