May I suggest using the "termcaps" functions (tgetent, etc.) which are 'higher-level' (so less prone to machine-level problems) and thus more reliable -- and they worked for me.