Special compile-time flags are required when compiling threaded applications on OSF/1. If you are compiling a threaded application, you must compile with the _REENTRANT flag:
cc -D_REENTRANT ...
The Berkeley DB library will automatically build with the correct options.