If you need a cronjob and use the exact code and user as CLI .. you may find that libraries cannot be found.
It turns out that even when using the same user on which CLI calls work, the ld_library_path is NOT read or applied.
So when using a bash shell script, make sure you have your environment paths in order before actually firing your line(s) with code.
In my case:
cron bash call to this file:
# Source global definitions
if [ -f /etc/bashrc ]; then
# User specific aliases and functions
# fire all code here[/code:1:2a24a9b68f]