Environment variable not working in another user account

I have the following in my .zshrc:

export MY_LIBRARY_DIR=~/bin

In Xcode I can set header/lib search path using something like $(MY_LIBRARY_DIR)/abc.

This works fine in my daily used user account. But today I found that this technique does not work in a test user account (for testing purpose only).

I even reboot my machine but still can't get it working.

Am I missing something very obvious???

BTW, I am using Xcode 14.2 and 14.3.1.

It's a stupid question. I found out why.

I set this up several years ago and I forgot the exact steps. Actually I have to define a custom path in Xcode Preferences->Locations->Custom Paths.

Environment variable not working in another user account
 
 
Q