View Single Post
cygwin gcc -O2 problem
Old
  (#1)
markus_heiden
Moderator / E[POD]bot developer
 
markus_heiden's Avatar
 
Status: Offline
Posts: 66
Join Date: Oct 2005
Location: Hamburg / Germany
Default cygwin gcc -O2 problem - 10-11-2005

Hi,

when I compile with the current cygwin g++ (v.3.4.4) I get 'strange' errors in the link step when I use the -O2 option for compiling. This happens since I use the stl.

Example:
g++ -mno-cygwin -w -O2 -march=i686 -I<some include dir...> -c -o xxx.o xxx.cpp
g++ -mno-cygwin -fPIC -shared -o my.dll xxx.o yyy.o....

The linker then shows multiple errors like this:
...undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::_close()'


This does not happen, when I do not use the -O2 option. Then everything works fine. What am I doing wrong?

Markus

Last edited by markus_heiden; 10-11-2005 at 16:57..
  
Reply With Quote