by Iñaki Arenaza.
I have just tried with that version (which by the way is an alpha version before 2.3 stable came out; you should really upgrade it to latest stable 2.3 version) and it has worked as expected.
I reset my installation back to the default original files and executed the "php -f ldapname.php ldap2" command without previously applying the 0001-... patch file and I got exactly the same errors as you. So I highly suspect you simply didn't apply the patch (maybe you executed patch in 'simulate' mode, using --dry-run option).
Saludos. Iñaki.