Hi Jeffer,
You can check the number of the error code definition in edge.h, search for E_ERROR. Code 1 is E_ERROR which will be returned if there is something not loaded correctly in one of the surfaces.
Are you able to write the background PNG picture to a bitmap file using surface->WriteBmp()?