Anytime you get errors that begin with "undefined reference to X", those are linker errors. What it means is that you are calling a function, or using a variable, but your linker can't find the function implementation anywhere. 9 times out of 10 this means you need to link to some external library.

If you do a search for CreateStreamOnHGlobal, you see in the documentation that is needs to be linked to Ole32.dll. A similar search on OleLoadPicture gives us olepro32.dll.