This forum has been archived. All content is frozen. Please use KDE Discuss instead.

NOMINMAX (again)

Tags: None
(comma "," separated)
wjh
Registered Member
Posts
5
Karma
0
OS

NOMINMAX (again)

Sat Apr 28, 2012 1:22 pm
I'm completely new to Eigen, but I have a quite large ongoing c++ project in which I would like to replace my current matrix library with Eigen. It's a Windows app and I'm using Visual Studio 2010 and MFC. I thought I'd better start by getting a feel for Eigen and just doing some of the stuff in the tutorials. So I set up a new toy dialog-based app and put
#include <Dense>
using Eigen::MatrixXd;
at the start of a cpp file. These are the last items before the start of code (after all other includes).

I didn't actually put any code in to do anything, but unfortunately I can't get even this to compile: I just get the error message "The preprocessor symbols 'min' or 'max' are defined. If you are compiling on Windows, do #define NOMINMAX to prevent windows.h from defining these symbols."

I tried putting #define NOMINMAX just above the #include <Dense> line, but that did not help.

I realize that this has been posted about before, but the main suggested solution (to put NOMINMAX in the pre-processor directive of the project properties) causes a cascade of compiler errors from other windows files
gdiplustypes.h(470): error C3861: 'min': identifier not found
afxtoolbar.h(171): error C3861: 'max': identifier not found
afxdesktopalertwnd.h(81): error C3861: 'max': identifier not

I have tried putting the #define NOMINMAX line in various locations withinin Eigen headers themselves, but none of them worked and anyway I didn't really know what I was doing so I was just thrashing about a bit.

Sorry if this is an ignorant question, but any help would be appreciated.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: NOMINMAX (again)

Sat Apr 28, 2012 4:45 pm
please try with a recent version of Eigen.
wjh
Registered Member
Posts
5
Karma
0
OS

Re: NOMINMAX (again)

Sat Apr 28, 2012 5:21 pm
ggael wrote:please try with a recent version of Eigen.

Well, that's impressive!
I downloaded this morning, reported a problem at lunch, got a reply at tea, downloaded again, and it all worked!!
Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: NOMINMAX (again)

Sat Apr 28, 2012 8:45 pm
Actually, this has been worked-around a long time ago....
wjh
Registered Member
Posts
5
Karma
0
OS

Re: NOMINMAX (again)  Topic is solved

Sat Apr 28, 2012 10:15 pm
ggael wrote:Actually, this has been worked-around a long time ago....


That's odd. I definitely thought I had downloaded the latest version this morning. But maybe my eye/mouse slipped down a line on the web page and I downloaded the (old) v 2.0 release by mistake.

Anyway, thank you for the rapid response and steer in the right direction.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]