【发布时间】:2015-09-28 03:31:00
【问题描述】:
是否可以在 Ubuntu Linux 上绕过 _NSGetExecutablePath 来代替非 Apple 特定的方法?
我正在尝试在 Ubuntu 上编译以下代码:https://github.com/Bohdan-Khomtchouk/HeatmapGenerator/blob/master/HeatmapGenerator2_Macintosh_OSX.cxx
根据我之前提出的这个问题:fatal error: mach-o/dyld.h: No such file or directory,我决定注释掉第 52 行,并想知道是否有一种通用的跨平台(非 Apple 特定)方式可以重写代码块567(_NSGetExecutablePath 块)以非 Apple 特定的方式。
Alen Stojanov 对 Programmatically retrieving the absolute path of an OS X command-line app 和 How do you determine the full path of the currently running executable in go? 的回答给了我一些关于从哪里开始的想法,但我想在开始做这件事之前确保我在正确的轨道上。
有没有办法修改_NSGetExecutablePath 以兼容Ubuntu Linux?
目前,我遇到以下编译器错误:
HeatmapGenerator_Macintosh_OSX.cxx:568:13: error: use of undeclared identifier
'_NSGetExecutablePath'
if (_NSGetExecutablePath(path, &size) == 0)
【问题讨论】:
标签: linux macos ubuntu compiler-errors