English 中文(简体)
dyld: warning, unknown environment variable: DYLD_LIBRARY_PATH_64-bit
原标题:

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!

最佳回答

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.

问题回答

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

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




相关问题
2 mysql instances in MAC

i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

Switching J2SE versions on Mac OS (SnowLeopard)

My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...

热门标签