got it to compile and link but it is error on first write of the output format context