how come when i recompile my source after making changes in a header file... the program doesn't update...
example... if i had string in the header that i wanted to edit... the edited string wouldnt show up in the program after i recompiled it...
how come when i recompile my source after making changes in a header file... the program doesn't update...
example... if i had string in the header that i wanted to edit... the edited string wouldnt show up in the program after i recompiled it...
ill post some example code... im just talking in general
example.h
example.cppCode:#include <iostream> using namespace std; // Prototypes void Say(); //Definitions void Say() { cout<<"Hello thel;asdlf"; // Not what i want }
This output after compiling would be...Code:#include "example.h" int main() { Say(); return 0; }
>Hello thel;asdlf
So if i wanted to change this... id make the following correction
example.h
However, if i recompiled the project... it would still outputCode:... void Say() { cout<<"Hello there!"; // This would be what i wanted } ...
>Hello thel;asdlf
On Dev-C++, it will only recompile the source if the source in the cpp file is edited, so just change something in the main cpp file and change it back, like removing a space or something and press F9 again, it is anoying though but this is how I do it.
It may be something to do with building something beforehand. What compiler, OS are you using, (not that I know what difference it makes, but someone should ... and it'll save them asking :P )?
Last edited by twomers; 05-14-2006 at 02:48 PM.
On Dev-C++, you can "rebuild all." Then you don't have to do the space/delete thing. I'm not at home, so I can't tell you what the keypress command is, but it should be 3 buttons to the right of the compile button on the toolbar, if that helps. Other IDEs may (should?) have a similar command.
There is a difference between tedious and difficult.
I see the Rebuild All... i always wondered what that was for...
thank you
There's also the Clean option - basically from my experience, IDE's
can be a little stupid when compiling multiple file projects, such
that only the source file containing main is recompiled (although
there may be other variants). Clean deletes any existing build
information and allows compile from scratch, whereas Rebuild All
may either combine the Clean and Build commands, or more
intelligently, rebuild all items older than the most recent file
timestamp. This is compiler specific I'd say, not that it would
matter too much for typical single programmer projects.
No No's:
fflush (stdin); gets (); void main ();
Goodies:
Example of fgets (); The FAQ, C/C++ Reference
My Gear:
OS - Windows XP
IDE - MS Visual C++ 2008 Express Edition
ASCII stupid question, get a stupid ANSI