致命错误:mach-o / dyld.h:没有这样的文件或目录 [英] fatal error: mach-o/dyld.h: No such file or directory
问题描述
我想在Ubuntu 14上编译这个src: https ://github.com/Bohdan-Khomtchouk/HeatmapGenerator/blob/master/HeatmapGenerator2_Macintosh_OSX.cxx 。
要编译此源代码,请执行: fltk-config --use-images --use-gl --compile HeatmapGenerator2_Macintosh_OSX.cxx
但是,我检索到以下错误:
HeatmapGenerator2_Macintosh_OSX.cxx:52:25:fatal error:mach-o / dyld.h:
没有这样的文件或目录
#include< mach-o / dyld.h>
^
编译终止。
我看过 http://ubuntuforums.org/showthread.php?t=1623945 但它没有帮助解决我的问题。
是 #include< mach-o / dyld.h>
不是一个有效的预处理指令在Ubuntu?在互联网上似乎没有什么书面的。也许这是一个苹果专用的库,可能不包括在Ubuntu?
任何关于如何绕过这个错误和成功生成二进制可执行文件的建议非常感谢。 / p>
EDIT :
当我注释掉 include< mach-o / dyld.h>
预处理器指令,我得到以下错误:
HeatmapGenerator_Macintosh_OSX.cxx:568:13:错误:使用未声明的标识符
'_NSGetExecutablePath'
if(_NSGetExecutablePath(path,& size)== 0)
有没有办法绕过这个错误,而不使用这个预处理器指令? _NSGetExecutablePath
只在src中使用一次,可能存在一个替代...
源代码根本不会在Linux下编译,因为它使用OSX的 dylib
(动态加载器)而不是Linux的动态加载器。
可能的解决方案:
- 将源代码从OSX移植到Linux。
- 使用OSX编译文件。
I'm trying to compile this src on my Ubuntu 14: https://github.com/Bohdan-Khomtchouk/HeatmapGenerator/blob/master/HeatmapGenerator2_Macintosh_OSX.cxx.
To compile this source code, do: fltk-config --use-images --use-gl --compile HeatmapGenerator2_Macintosh_OSX.cxx
However, I retrieve the following error:
HeatmapGenerator2_Macintosh_OSX.cxx:52:25: fatal error: mach-o/dyld.h:
No such file or directory
#include <mach-o/dyld.h>
^
compilation terminated.
I've looked into http://ubuntuforums.org/showthread.php?t=1623945 but it didn't help solve my issue.
Is #include <mach-o/dyld.h>
not a valid preprocessor directive in Ubuntu? There seems to be very little written about it on the Internet. Perhaps it is an Apple specific library that might not be included in Ubuntu?
Any suggestions on how to bypass this error and successfully generate a binary executable file are greatly appreciated.
EDIT:
When I comment out the #include <mach-o/dyld.h>
preprocessor directive, I get the following error:
HeatmapGenerator_Macintosh_OSX.cxx:568:13: error: use of undeclared identifier
'_NSGetExecutablePath'
if (_NSGetExecutablePath(path, &size) == 0)
Is there a way to bypass this error without using this preprocessor directive? _NSGetExecutablePath
is only used once in the src, perhaps there exists an alternative...
That source code simply won't compile under Linux as it's designed to use OSX's dylib
(dynamic loader) rather than Linux's dynamic loader.
Possible solutions:
- "Port" the source code from OSX to Linux.
- Use OSX to compile the file.
这篇关于致命错误:mach-o / dyld.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!