Thanks for your replies and help, all of you.
I tried the pyconfig.h hack, and after a complete rebuild of opencv I get no errors, but running a debug version my program still exits with an error code, so I reverted it again. Will keep the link, though, I haven’t found many people documenting newer builds of opencv, so that’s nice to have.
Laurent, it seems you are right, I thought the _d.lib would be enough, but most people having similar issues apparently have to build the python debug version as well. I might do that, or try to somehow include the release opencv libs into a debug project.