Added extern and export for the error() function