r3 - 02 Sep 2011 - 22:11:41 - RickMachYou are here: TWiki >  Documentation Web  >  AskedQuestions > MaxRedifinition

Question

I was looking at GPStk stringutils. There's an issue there with: "std::numeric_limits::max());" Apparently if you include windows.h it defines "max" in the std namespace, so there is a redefinition conflict there.

I was figuring putting NOMINMAX as a preprocessor in our C++ projects that include windows.h. Is this the appropriate fix?

-- JasonTobiasz - 31 Aug 2010

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Jason, after asking some of our Windows folks, the recommended solution is to "use qualifiers in your code to remove the ambiguity, i.e. std::max() everywhere instead of just max(). This is purely a Windows issue." Not necessarily a quick fix, but should resolve the issue.

-- SusanCummins - 18 Oct 2010

 
Change status to:

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
WEBLOGOALT
This site is powered by the TWiki collaboration platformCopyright amp;© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback