Advertisement

Cygwin compiler errors left and right

Started by January 28, 2012 05:39 PM
2 comments, last by SiCrane 12 years, 9 months ago
I recently switched over to NetBeans from VS 2010. For the compilers I used Cygwin, but its been doing nothing but give me compiler errors.
I've searched for 2 days straight for why I keep getting problems, I've installed every package.
Here is a chunk of the error

/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:232:5: error: template declaration of ‘const _Tp& std::min’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:235:7: error: expected primary-expression before ‘if’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:235:7: error: expected ‘}’ before ‘if’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:237:7: error: expected unqualified-id before ‘return’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:253:5: error: ‘max’ declared as an ‘inline’ variable
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:253:5: error: template declaration of ‘const _Tp& max’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:256:7: error: expected primary-expression before ‘if’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:256:7: error: expected ‘}’ before ‘if’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:258:7: error: expected unqualified-id before ‘return’
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/bits/stl_algobase.h:259:5: error: expected declaration before ‘}’ token

I've put the whole build log on pastebin here http://pastebin.com/8v08wKpT

I've got every package installed (even the unnecessary ones) I've got it all set up, the compilers, makers, etc, etc. all set.
The project shows no warnings or errors one moment, then it starts saying it can't find reference to D3DDevice->release() and that it can't find queue and other little random stuff.
The project built fine in VS 2010. I've got all the library directories and include directories set.

Anyone have any clue what is going on?
I'd stick with VS 2010 just the intellisense never works, and half the time it doesn't find syntax errors until building.

Any and all help is appreciated,
Thanks in advanced,
Bombshell
It looks like max and min have been defined as macros in some header or other? (which are then causing a f**k up with the declaration of std::min/std::max). Not sure why anyone would want to use cygwin though :|
Advertisement
Yes: <windows.h> craps all over the global namespace. Try including that file at the top of your source before any other headers and you should #undef min and max rigtht afterwards.

Stephen M. Webb
Professional Free Software Developer

Or #define NOMINMAX globally for your project or before any inclusion of windows.h.

This topic is closed to new replies.

Advertisement