问题
I'm having an issue compiling code - specifically METIS - Serial Graph Partitioning and Fill-reducing Matrix Ordering.
I've successfully managed to make Visual Studio 2013 Project out of the source files two ways: using CMake GUI (version 3.4.3) and using Command Line.
However, in both cases when I try to build the created project in Visual Studio, I'm getting an error: Error C2059: syntax error : '('
on line
_CRTIMP double __cdecl rint(_In_ double _X);
where _CRTIMP
is defined this way:
#define _CRTIMP __declspec(dllimport)
Is this issue caused in the process of creating Visual Studio Project by CMake, or is it a issue in source files of METIS?
回答1:
go to : metis\GKlib\gk_arch.h and metisbin.h and metislib.h. Remove or rename #define rint(x) ((idx_t)((x)+0.5)) it's causing a conflict with the rint function in math.h.
回答2:
only comment out the line #define rint(x) ((idx_t)((x)+0.5))
in metis\GKlib\gk_arch.h is enough.
来源:https://stackoverflow.com/questions/35562135/rint-issue-after-creating-vs-project-using-cmake