|
|
| DevCpp project files |
|
MindCode
Member #2,031
March 2002
|
My project has become complex enough that it requires many separate source files to be compiled and linked together. I know that I can add source files to the project, but does DevC++ automatically link their object files together when it's compiled with Gcc? I've also had troubles with include files. Several of the source files include the same headers, and when I build them (with the above assumption about linking), the compiler barfs out "multiple declaration" errors. Is their any suggestions around this? ______________________________________ |
|
Surt
Member #273
April 2000
|
Dev-C++ will link all objects created from project files. Encapsulate the contents of your headers with: #ifndef HEADER_ID__ #define HEADER_ID__ // content here #endif To prevent redefinition. --- |
|
MindCode
Member #2,031
March 2002
|
The thing that's confusing me is that I have done that. Each header has it's own definition for preventing that, but it still barfs these errors. I really don't get it. ______________________________________ |
|
Surt
Member #273
April 2000
|
Are you sure you've gotten every header? Are you sure the HEADER_ID__ is being defined? Give us the error messages so that we may interperet them for ourselves. --- |
|
MindCode
Member #2,031
March 2002
|
Oh darnit I'm a moron. I haven't checked this yet, but I know what happened. What I was doing before was "#include"'ing the .cpp files rather than compile+link them (I know it sounds dumb), and I forgot to delete those include statements so the .cpp files were essentially begin compiled and linked twice. ______________________________________ |
|
Johan Halmén
Member #1,550
September 2001
|
Other IDEs have one button for compiling and another for making. When compiling, only the active source file gets compile, not linked. When making, all files are compiled and linked. This is a convenient way to check the syntax on one file. (I know, another is to write good code in the first place:P) Dev-C++ has only this compile command that performs a total make of the whole project, which is time consuming. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
|
Cage
Member #1,277
March 2001
|
The new versions of Dev-C++ use makefiles and your choice of fast/inaccurate or slow/accurate dependency generation, so only the most recently changed files get recompiled.
----- |
|
|