A linking problem with current GCC (4.5.3)

Angelo Graziosi angelo.graziosi@alice.it
Wed Dec 12 21:50:00 GMT 2012


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...


Ciao,
  Angelo.

--
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