I recently tried to run 1 of my 'old' OpenGL/ES programs on my Pi 2 (Stretch). It didn't work because LD_LIBRARY_PATH wasn't set.
I've put "export LD_LIBRARY_PATH=/vc/opt/lib" (or something similar!) in ~/.bash_profile. When I first log in (using the text console, not X), LD_LIBRARY_PATH is set. If I then run `startx` then click on the icon to start lxterminal, LD_LIBRARY_PATH isn't set.
(Weirdly, I did `ls -lut ~/.bash*` and none of them seemed to have been accessed recently!)
Any idea how to keep LD_LIBRARY_PATH set?
(I added an echo to ~/.bash_profile, and, sure enough, it's run when I initially log in but not when starting lxterminal.)