FLTK在xCode math.h错误 [英] FLTK in xCode math.h error

查看:402
本文介绍了FLTK在xCode math.h错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在xCode中设置FLTK。经过一点点的努力,我认为我成功地链接所有的库,等...但是,我现在得到以下错误从位于FL / include文件夹中的math.h文件:

I have been trying to set up FLTK in xCode. After a little struggling I thought I was successful in linking all the libraries, etc... However, I am now getting the following error from the math.h file located in the FL/include folder:

'/usr/include/math.h'file not found

从以下代码:

// Xcode on OS X includes files by recursing down into directories.
// This code catches the cycle and directly includes the required file.

#ifdef fl_math_h_cyclic_include 
#  include "/usr/include/math.h"
#endif

我已经阅读过几个不同的解决方案,但没有一个似乎为我工作。在该目录中没有文件 math.h 。感谢您的帮助!

I have read through a few different solutions posted before, but none of them are seeming to work for me. There is no file math.h located in that directory. Thanks in advance for the help!

推荐答案

我在Linux上有类似的问题。我遇到的方式是

I had a similar problem on Linux. The way I got around it was


  1. 在FL目录中,将math.h重命名为Fl_math.h

  2. 在所有文件中,#include FL / math.h更改为FL / Fl_math.h

基本问题是默认情况下没有定义像M_E这样的常量,所以Fl_math.h定义了它们。在Linux / MS环境中,所有Fl_math.h需要做的是

The base problem is that constants like M_E are not defined by default so Fl_math.h defines them. On the Linux/MS environment, all Fl_math.h needs to do is

#define _USE_MATH_DEFINES
#include <cmath>

Xcode环境可能是相同的。

The Xcode environment might be the same.

这篇关于FLTK在xCode math.h错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆