Not sure what exactly do you mean, but if you're referring to the fact that you had to install opencv-dev package, then yes, that's necessary, I thought you knew that already and your only problem was that pkg-config command didn't work.
-dev packages contain necessary headers, so if you want to compile something against some library, then you need a corresponding -dev package. That's the same on pretty much any commonly used Linux distro out there.