Jump to content



Cygwin compiler errors left and right

  • You cannot reply to this topic
3 replies to this topic

#1 bombshell93   Members   -  Reputation: 104

Like
0Likes
Like

Posted 28 January 2012 - 11:39 AM

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

Ad:

#2 RobTheBloke   Members   -  Reputation: 796

Like
0Likes
Like

Posted 07 February 2012 - 09:46 AM

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

#3 Bregma   Members   -  Reputation: 1216

Like
0Likes
Like

Posted 07 February 2012 - 11:43 AM

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

#4 SiCrane   Moderators   -  Reputation: 2376

Like
0Likes
Like

Posted 07 February 2012 - 11:47 AM

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






We are working on generating results for this topic
PARTNERS