I'm a bit lost...
I think the phrase "Site map" refers to Index and Contents pages of the chm file here.
I temporarily removed the items "Contents file" and "Index file" from the Options section of the hhp file which resulted in successful compilation and confirmed this idea. After successive restoring these item I found out that the contents file is the guilty one.
Then I removed all <LI> nodes from the index.hhc file (--> successful compilation) and restored them successively until the compilation error returned.
The first item which triggered the compilation error was:
<LI><OBJECT type="text/sitemap"><param name="Name" value="dwBytesToWrite"><param name="Local" value="_ld_spi_f_t_d_i_8cpp.html#af8bac4f0406d0ddd199751ecbce27708"><param name="ImageNumber" value="11"></OBJECT>
This means that the item "dwBytesToWrite" of the Contents page links to the anchor "#af8bac4f0406d0ddd199751ecbce27708" in file "_ld_spi_f_t_d_i_8cpp.html". But this anchor is not defined in this file - therefore the error message is correct. Instead, the anchor is declared in file "namespace_f_t_d_i_af8bac4f0406d0ddd199751ecbce27708.html". I don't know to make a logical connection between these two files - although there must be one because MS HTML Help workshop compile the project without any issues.
But maybe they are doing something similar what I am proposing now as a workaround: Compile the project with the option --no-html-scan. With it the project can be compiled successfully.
The problem is that you must specify all files in the "Files" section of the hhp project, like we had discussed in the other thread.
Maybe procedure TChmProject.ShowUndefinedAnchors which is bypassed if no-html-scan is set should be modified to show a warning instead of an error in case of a missing file?
procedure TChmProject.ShowUndefinedAnchors;
var
i:Integer;
begin
for i := 0 to fAnchorList.Count-1 do
if fAnchorList.Objects[i] <> nil then
Error(chmwarning,'Anchor '+fAnchorList[i]+' undefined; first use '+TFirstReference(fAnchorList.Objects[i]).Location);
// was: chmerror
end;