rint() issue after creating VS Project using CMake

孤者浪人 提交于 2019-12-04 06:36:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!