Currently lame provides native support for a bunch of uncompressed audio formats (WAV, AIFF, RAW...). External libmpg123 provides support for mpeg audio formats, and libsndfile does so for further compressed/uncompressed formats. Now, the best place for libhdcd inclusion would be the latter, so in a glance you will get hdcd format supported in a whole range of different applications (including lame). The devs are also quite reactive.
Latest time I needed the lame DLL (many years ago, truth be told) I used a mingw environment and the configure script as well, as the static library libmp3lame.a is needed indeed. Well, I think I used the script Makefile.mingw32 located into Dll/ subdir, this created the file "BladeMP3Enc.dll" which I renamed into lame_enc.dll . Give it a try/play with it, everything you need is there.
There is a pull request I created some time ago, which is still waiting for Erik to merge, extending this default behaviour when the caller application doesn't want to apply any amplitude modification to the audio source: https://github.com/libsndfile/libsndfile/pull/314 this patch will hopefully prevent the replay gain discrepancy.
As a trivial check, feed lame with a flac encoded file. libsndfile can decode flac, plain lame can't. (my bet: linux distributions always link against libsndfile)
Which is the sample format for the source wav file? integer? float? bit depth? is any of both lame executables linked against libsndfile ? Libsndfile DOES amplify the source content when picking a file encoded as floating point.
Can you provide more details in order to make the issue repeatable?
Attaching new version of the same patch. Should patch#83 ever be merged, this would became critical (it is useful even now, though).
In practice, this is VERY hard to achieve. On the first hand, MPEG audio Layer III allows for any frames to keep some room for data belonging to upcoming frames, in order to give them more bits (and more quality in the end). This is called 'bit reservoir' and this makes the frames from the beginning of your second file different from the last frames at the end of your first file, as the latter don't need to keep any room because they don't have any upcoming frames. On the other hand, lame allows...