dyld: warning, unknown environment variable: DYLD_LIBRARY_PATH_64-bit
Asked Answered
A

3

2

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!

Altheta answered 2/9, 2010 at 5:37 Comment(4)
You cannot have - as part of an environment variable name.Paris
Yep, and DYLD_LIBRARY_PATH_64-bit doesn't appear in export or in echo $PATH. But the warnings are still in the console. Do you have any ideas on how I can get rid of them?Altheta
Why don't you reboot the machine?Norrisnorrv
I tried that, but no go. One way to suppress the warning messages is to add DYLD_PRINT_ENV, but all this does is flood the console with more messages, like dyld: i'm in your libs, loading your filez.Altheta
A
1

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.

Altheta answered 2/9, 2010 at 21:13 Comment(0)
T
0

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
Tizzy answered 10/6, 2012 at 21:18 Comment(0)
A
0

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

Aldredge answered 20/6, 2014 at 5:31 Comment(2)
A little more explanation might help out the fellow programmers to understand how the reference link works.As in future the reference link might not exist anymore.Nitro
the future has come and the link no longer works, per @NJInamdarLipp

© 2022 - 2024 — McMap. All rights reserved.