You have messed your code too much, so it is best to restart in a clean area. Maybe you have misconfigured the code or arent using the correct settings or compiler.
Read
gnuplot homepage there you find the documentation and some example to learn how to use it correctly.