I am having a small problem using these directives. I usually use them just to avoid multiple inclusions of files or for the usual routines. Now I was joking a bit with them defining something like this:
When I run this trivial program, my AVG tells me that it has just found a trojan "Agent4.TAL" in the degub folder of my stupid "project".
Any ideas why this is happening?
As you have them now, they are completely useless.
Yes, that's what I have been doing for a life :(
But we have to use them when we are talking about inclusion of multiple files, as I said, when we are talking about big projects.
But we have to use them when we are talking about inclusion of multiple files, as I said, when we are talking about big projects.
Yes, but you have to put your code between ifndef/endif, not after them.
And use them only within files which will be included (.h files). And make sure that every include guard macro has unique name.
The AV problem has nothing to do with #include headers or anything.
Antivirus companies are a little overzealous when reporting malware. It is a problem particularly among Delphi users -- because AV companies will tag any Delphi-produced program as dangerous, just because someone, somewhere wrote a virus with the same version of Delphi -- and the compiled executable happens to have the same embedded timestamp as said 'virus'.
When that happens, wait a few minutes and try recompiling your entire program from source. That should fix the problem. If it doesn't, submit it to the AV vendors.
Yes, that's exactly what I had done ;) Thank you anyway for sharing your knowledge!