From: Carlo W. <li...@us...> - 2002-02-21 18:22:17
|
CVSROOT : /cvsroot/libcw Module : src Commit time: 2002-01-21 18:22:11 UTC Modified files: libcwd/example-project/README libcwd/example-project/program.cc Log message: Update of the example project. ---------------------- diff included ---------------------- Index: src/libcwd/example-project/README diff -u src/libcwd/example-project/README:1.4 src/libcwd/example-project/README:1.5 --- src/libcwd/example-project/README:1.4 Sun Aug 19 09:53:42 2001 +++ src/libcwd/example-project/README Thu Feb 21 10:22:01 2002 @@ -121,21 +121,6 @@ It did not link with libcwd, nor does libcwd need to be installed. -There are files that are generated in maintainer-mode (and later put -into the distribution) ONLY when you issue a `make' and when configured -with --enable-maintainer-mode. Therefore, the following will not work: - - make maintainer-clean - aclocal - autoheader - autoconf - automake -a - ./configure - make - -Because now the file `nodebug.h' was never generated. - - We have three different types of makefiles: 1) makefile : The makefile for the master himself in order to @@ -153,9 +138,7 @@ when the package is configured with --enable-maintainer-mode. Note that also Makefile.{am|in} can contain - maintainer specific rules. In this example - project `maintMakefile.in' is used to generate - the file `nodebug.h'. + maintainer specific rules. 3) Makefile.am : The makefile that describes how to build the application. @@ -184,6 +167,8 @@ ./configure make -Now this did work (of course), because 'nodebug.h' is part of the -distribution. + +PS If you see a file 'debug.h.maintainer' then you probably checked + out this directory from the libcwd CVS repository. That file + is not supposed to be a part of your project, just remove it. Index: src/libcwd/example-project/program.cc diff -u src/libcwd/example-project/program.cc:1.3 src/libcwd/example-project/program.cc:1.4 --- src/libcwd/example-project/program.cc:1.3 Sat Dec 29 20:17:49 2001 +++ src/libcwd/example-project/program.cc Thu Feb 21 10:22:01 2002 @@ -1,12 +1,25 @@ #include "sys.h" -#include <iostream> +#include <iostream> // Needed for std::cout and std::endl +#ifdef CWDEBUG +#include <cstdlib> // Needed for getenv +#endif #include "debug.h" int main(void) { + // You want this, unless you mix streams output with C output. + // Read http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8 for an explanation. + std::ios::sync_with_stdio(false); + + // This will warn you when you are using header files that do not belong to the + // shared libcwd object that you linked with. Debug( check_configuration() ); + + // Turn on the custom channel. Debug( dc::custom.on() ); - Debug( libcw_do.on() ); + + // Only turn on debug output when the environment variable SUPPRESS_DEBUG_OUTPUT is not set. + Debug( if (getenv("SUPPRESS_DEBUG_OUTPUT") == NULL) libcw_do.on() ); Dout(dc::custom, "This is debug output, written to a custom channel (see ./debug.h and ./debug.cc)"); ----------------------- End of diff ----------------------- |