include guard problem

I just switched from codeblocks to c-free 3.5 as it is the only option available. I had to fix a few errors warnings in order to get code that had previously compiled on codeblocks.

I had to comment out:
SIZE_T zee;
because I was getting error
syntax error before ';'

evidently it was a variable not being used anyway because when i tried to compile it again i didn't get any error messages at all, but appears to be linking in an infinite loop which must mean that somewhere I forgot an include guard or something . Problem is where? How can I find it?
How can I find it?


Try looking at your headers to make sure they're guarded?


Although are you sure this has anything to do with include guards?
Last edited on
what else could be causing the compiler to compile in an infinite loop? It goes from doing:

Compiling.....

to Linking...

back to Compiling...

back to Linking...

back to Compiling...

and on again to Linking...

and so on and so forth?
I did find 1 file btw that was not guarded, but I am farily certain that I only included it 1 time, and even after I added an include guard to the file in question it continues to compile infinitely...
That's not how it works. Everything is compiled and then linked. It does all compiling at once and then never again. After that the linker links everything together with a virtual chain and then crams it into the final package to be shipped off to a file somewhere. Your compiler must be hiring mentally unstable employees...
or maybe its a virus?
Do you often get viruses that make your compiler hire mentally unstable employees?
Ok I don't exactly understand what I did, but its a problem I've encountered before, and had sort of forgotten about. Codeblocks, when you recompile a file with F9, it overwrites any object file from a previous compilation of the same file, c-free doesn't, so after I had made some changes to my source code, and then retried to compile, the .o file was still there and the compiler didn't like it so it started puking its guts out.
Codeblocks, when you recompile a file with F9, it overwrites any object file from a previous compilation of the same file, c-free doesn't, so after I had made some changes to my source code, and then retried to compile, the .o file was still there and the compiler didn't like it so it started puking its guts out.


This is new news to me! So to be safe, for every compile build I should write a rule in my Makefile to remove ALL *.o so I can get a clean build? This mean I will get a long compile time for every build even when say I add just one line of debugging statement ???!!! :(
Thats only if you use C-Free 3.5. I usually use Codeblocks but sometimes have to use C-Free. Which IDE do you use?
Currently I am not doing large scale C++ development so I am using Notepad++ (not really an IDE though).
Currently I am not doing large scale C++ development so I am using Notepad++ (not really an IDE though).


Notepad++ is not an IDE.

Get an IDE. Visual C++ Express is free and terrific.
Is Notepad++ an actual software program, or are you just making a play on words to associate notepad with c++?
Notepad++ is a program that extends functionality of Notepad with syntax highlighting and other features (you can also install modules on it, like a console emulator).
Topic archived. No new replies allowed.