The '>' redirection is not valid in execl as it is a shell command....
Try to look at Running a script from execl() for an example of how to invoke a shell to do your execution....
If you want to avoid the shell invokation, you will have to do a 'dup' call to close the stderr/stdout in the chiled process and open it to the file -- you can see an example here; fork, pipe exec and dub2
Or in your child process, you can force the output to a specific file, by closing the stdout and reopen it as the file, like this;
if (pid == 0)
{
//child process.
close(1);
creat("/tmp/version",0644); // this will create a new stdout
close(2);
dup(1); // this will make stderr to also go to the same file.....
execl("/opt/bin/version.out", "version.out",0);
perror("execl didn't work"); // print out the error if execl failed...
_exit(0);
}.....