[sheepdog-users] Compile error whit --enable-trace: /usr/include/bfd.h:37:2: error: #error config.h must be included before this header

Marcin Mirosław marcin at mejor.pl
Sat Feb 22 23:25:12 CET 2014


W dniu 2014-02-22 21:21, Marcin Mirosław pisze:
> Hi! When I compiling sheepdog with --enable-debug then
> --enable-trace turns on automagically. With --enable-trace sheepdog
> compilation stops with error: $ gcc -DHAVE_CONFIG_H -I.
> -I../include  -I../include -I../include -DENABLE_TRACE   -g -O2 -O0
> -ggdb3   -pg   -Wall -Wshadow -Wmissing-prototypes
> -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith
> -Wwrite-strings -Wbad-function-cast -Wmissing-format-attribute
> -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long
> -Wno-strict-aliasing -Wcast-align -D_GNU_SOURCE -D_LGPL_SOURCE
> -std=gnu99 -MT trace.o -MD -MP -MF .deps/trace.Tpo -c -o trace.o
> `test -f 'trace/trace.c' || echo './'`trace/trace.c In file
> included from trace/trace.c:14:0: /usr/include/bfd.h:37:2: error:
> #error config.h must be included before this header make[1]: ***
> [trace.o] Error 1 make[1]: Leaving directory
> `/tmp/sheepdog/sheepdog-orig/sheep' make: *** [all-recursive] Error
> 1
> 
> I have binutils-2.23.2. Relevant fragment of /usr/include/bfd.h
> is: /* PR 14072: Ensure that config.h is included first.  */ #if
> !defined PACKAGE && !defined PACKAGE_VERSION #error config.h must
> be included before this header #endif
> 
> How fix this issue?

By trial and error I've found that change as below fixes my problem.
But I have no idea if this solutions is correct and doesn't have bad
side effects.

--- a/sheep/trace/trace.c
+++ b/sheep/trace/trace.c
@@ -11,6 +11,7 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */

+#include "config.h"
 #include <bfd.h>

 #include "trace.h"







More information about the sheepdog-users mailing list