compile and run with

./script /path/to/avi/file.avi

to run the programs separately:

export LD_LIBRARY_PATH="."
./works /path/to/avi/file.avi

./fails /path/to/avi/file.avi


the error in the shared version is:
<codec keeper> : WARNING: plugin /usr/lib/avifile0.7/win32.so could not be opened: /usr/lib/avifile0.7/win32.so: undefined symbol: GetCodecInfo__CQ23avm13IAudioDecoder

