A linking problem with current GCC (4.5.3)
marco atzeri
marco.atzeri@gmail.com
Thu Dec 13 13:21:00 GMT 2012
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
More information about the Cygwin
mailing list