This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

g++ -mno-cygwin header problems, new.h ?


I am trying to use #include <vector> with g++ -mno-cygwin. My test program is

$ cat test.c
#include <vector>

int main()
{ return 0;
}

which compiles fine with g++ without -mno-cygwin.
To try the same with -mno-cygwin, I copied the c++ include files from c:\cygwin\usr\include\g++-3 to c:\cygwin\usr\include\mingw\g++-3 (as described in http://www.colomsat.net.co/freehost/ngiraldo/cppcygwin.html), and try to compile again with -mno-cygwin. Now I get lots of errors:

$ g++ -mno-cygwin test.c
In file included from /usr/local/include/g++-v3/backward/new.h:33,
from /usr/include/mingw/g++-3/stl_algobase.h:52,
from /usr/include/mingw/g++-3/vector:30,
from test.c:1:
/usr/local/include/g++-v3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
In file included from /usr/local/include/g++-v3/backward/new.h:34,
from /usr/include/mingw/g++-3/stl_algobase.h:52,
from /usr/include/mingw/g++-3/vector:30,
from test.c:1:
/usr/local/include/g++-v3/new:79: `size_t' undeclared in namespace `std'
/usr/local/include/g++-v3/new:79: declaration of `operator new' as non-function
/usr/local/include/g++-v3/new:79: invalid declarator
/usr/local/include/g++-v3/new:80: `size_t' undeclared in namespace `std'
/usr/local/include/g++-v3/new:80: declaration of `operator new []' as

... and many more.
I guess the problem starts when new.h is included, which is not a mingw include file.
I get the same error if I try to use the c++ include files that come with the mingw distribution (using -I /mingw/include/g++-3, where /mingw is where I installed mingw). I am not sure why I get the deprecated warning, as I am using #include <vector>, not #include <vector.h>.

Does anybody know what is the correct way to include the c++ header files with -mno-cygwin?

Thanks in advance,

Michiel de Hoon
University of Tokyo, Human Genome Center.





--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]