dyld:警告,未知环境变量:DYLD_LIBRARY_PATH_64 位

发布于 2024-09-16 23:50:36 字数 1032 浏览 12 评论 0原文

我使用 Mac OS X 开发人员工具捆绑的属性列表编辑器将环境变量 DYLD_LIBRARY_PATH_64 位设置为文件 ~/.MacOSX/environment.plist 中的值 path/to/dylib。我保存了该文件并退出。

重新登录后,控制台显示多条消息“dyld:警告,未知环境变量:DYLD_LIBRARY_PATH_64位”。我使用属性列表编辑器从environment.plist 中删除了该条目,保存文件并注销。

我重新登录,警告消息仍然存在。 dyld 手册页显示了一个常量列表,这些常量看起来与我任性的环境变量类似,因为它们都以“DYLD_”开头。源文件 dyld.cpp 在一长行 DYLD 常量之后显示了 else,其中包含打印完全相同的警告消息的代码。也许我在环境变量命名上离太阳太近了。我以为我们是自由的!

我尝试了 update_dyld_shared_cache 无济于事。也许我错过了一些重要的标志?

我在 /etc/launchd.conf 中添加了“setenv DYLD_LIBRARY_PATH_64-bit path/to/dylib”,试图将一个(显然格式错误的)环境变量添加到我的路径中,希望如果它出现,我可以删除它 - 但没有成功。

从命令行,导出不显示 DYLD_LIBRARY_PATH_64 位。以下是一些示例输出:

$ unset $DYLD_LIBRARY_PATH_64-bit 
-bash: unset: -b: invalid option

$ echo $DYLD_LIBRARY_PATH_64-bit
-bit

$ unset DYLD_LIBRARY_PATH_64-bit
-bash: unset: `DYLD_LIBRARY_PATH_64-bit': not a valid identifier

这个故事的寓意是永远不要使用属性列表编辑器,至少对于动态库路径。嗯,不 - 这个故事的寓意是永远不要在环境变量名称末尾使用破折号,因为它们看起来像标志

话虽如此,您对摆脱这个伪装的环境变量以及清除我的控制台上重复的 dyld 警告有什么建议吗?

谢谢!

I used the bundled Property List Editor of Mac OS X Developer Tools to set an environment variable DYLD_LIBRARY_PATH_64-bit to the value path/to/dylib in the file ~/.MacOSX/environment.plist. I saved this file and logged out.

Upon logging back in, the console displayed multiple messages of "dyld: warning, unknown environment variable: DYLD_LIBRARY_PATH_64-bit." I removed the entry from environment.plist with the Property List Editor, saved the file and logged out.

I logged back in, and the warning message persists. The dyld man page displays a list of constants which appear similar to my wayward environmental variable, as they all start with "DYLD_." A source file, dyld.cpp, shows an else after a long line of DYLD constants, with code to print the very same warning message. Maybe I flew too close to the sun of environmental variable naming. I thought we were free!

I tried update_dyld_shared_cache to no avail. Perhaps I am missing some important flags?

I added "setenv DYLD_LIBRARY_PATH_64-bit path/to/dylib" to /etc/launchd.conf in an attempt to add a (apparently malformed) environmental variable to my paths, hoping that if it showed up, I could delete it - without success.

From the command-line, export does not show DYLD_LIBRARY_PATH_64-bit. Here's some sample output:

$ unset $DYLD_LIBRARY_PATH_64-bit 
-bash: unset: -b: invalid option

$ echo $DYLD_LIBRARY_PATH_64-bit
-bit

$ unset DYLD_LIBRARY_PATH_64-bit
-bash: unset: `DYLD_LIBRARY_PATH_64-bit': not a valid identifier

The moral of the story is to never use Property List Editor, at least with dynamic library paths. Well no - the moral of the story is never use the dash at the end of environmental variable names, since they look like flags.

With that said, do ya'll have any recommendations for getting rid of this masquerading environmental variable, and of cleaning my console of repeated dyld warnings?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

坚持沉默 2024-09-23 23:50:36

这是解决属性列表编辑器无意中设置的不可见环境变量的一种方法:重新格式化机器。清洁它。用火将其清洗干净。

对我们所有人,尤其是我自己来说,这是一个发人深省的教训。使用属性列表编辑器时,不要在环境变量中使用破折号,以免您的计算机整天都充斥着 dyld: 警告消息。主板有祸了,因为她的 CPU 生产力很低,相反她只能将消息打印到文件 2(标准错误)。

说真的:属性列表编辑器将让你指定 Bash 永远不会让你逃脱的虚假环境变量。从“用户必须知道他在做什么”的意义上来说,Mac OS X 变得类似 UNIX。

Here's one way to solve an invisible environment variable inadvertently set by the Property List Editor: re-format the machine. Clean it. Clean it with fire.

A sobering lesson for all of us, and especially myself. Use not the dash in your environment variables when using Property List Editor, lest you be riddled with dyld: warning messages for all the days of your machine. Woe to the motherboard, for her CPU is barren of productivity, and instead she is reduced to printing messages to file 2 (standard error).

No seriously: Property List Editor will let you specify bogus environmental variables that Bash would never let you get away with. In the sense of "the user must know what he's doing," Mac OS X becomes UNIX-like.

笑看君怀她人 2024-09-23 23:50:36

实际上,如果您设置的任何以 DYLD_ 开头的环境变量不在 苹果列表
你收到一条唠叨信息。

我希望有一个标志可以将其关闭

Actually if you set any env var that starts with DYLD_ that isn't in the apples list
you get a nag message.

I am hoping there is a flag to turn this off

梦醒灬来后我 2024-09-23 23:50:36

在 DYLD 库路径变量的类似问题上,什么对我有用,该变量在 Mac 上不会消失:

在我 unsetunset 命令,以及更好的措施代码>它我再次导出它...

即类似

$ unset DYLD_LIBRARY_FALLBACK_PATH    
$ export DYLD_LIBRARY_FALLBACK_PATH

What worked for me on a similar problem with a DYLD libarary path variable which wouldn't go away on a mac:

Use the unset command, and the for good measure, after I unset it I exported it again...

i.e. something like

$ unset DYLD_LIBRARY_FALLBACK_PATH    
$ export DYLD_LIBRARY_FALLBACK_PATH
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文