Errors? Warnings? Unexpected output? You need to be more specific than My code doesn't work. What's wrong with it? Pardon the reply, but it's kinda frustrating when vital details aren't provided.
So, I'll ask nicely of you. Can you describe what the issue is?
main.obj : error LNK2005: "int __cdecl cal(void)" (?cal@@YAHXZ) already defined in functions.obj
C:\Users\Dario\Desktop\Projects\Project1\Debug\Project1.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It's telling you that cal( )'s body has been defined on numerous occasions. I've spotted functions.obj, which could only mean that functions.h has an associated source module. Could you post that source module?
Note that header modules should only contain constants, declarations and prototypes (with the exception of templates).
@JakeIsBoss:
No it wouldn't. Firstly, as Framework pointed out, the error is referring to cal(), secondly, bool run = true is defined in the main () function and the cal () function, so there will, again be no error of the kind