Grive / grive

an open source Linux client for Google Drive
http://www.lbreda.com/grive/start
GNU General Public License v2.0
1.59k stars 379 forks source link

config.h must be included before this header #202

Open thiagowfx opened 11 years ago

thiagowfx commented 11 years ago

I can't compile grive. I download the source, and then:

cd /path/to/grive/folder
cmake .
make

Then I got the following error:

[ 94%] Building CXX object libgrive/CMakeFiles/grive.dir/src/bfd/SymbolInfo.cc.o
In file included from /home/thiago/Downloads/grive-0.2.0/libgrive/src/bfd/SymbolInfo.cc:25:0:
/usr/include/bfd.h:37:2: error: #error config.h must be included before this header
 #error config.h must be included before this header
  ^
make[2]: ** [libgrive/CMakeFiles/grive.dir/src/bfd/SymbolInfo.cc.o] Erro 1
make[1]: ** [libgrive/CMakeFiles/grive.dir/all] Erro 2
make: ** [all] Erro 2

Am I compiling it wrong?

I'm using Arch Linux right now.

ernstki commented 10 years ago

(This bug is a duplicate of #204.)

This bug is binutils #14243, marked as WONTFIX. I found a workaround at https://bugs.gentoo.org/show_bug.cgi?id=428728#c9 (which led me to the binutils bug) that just involves adding some #define to libgrive/src/bfd/SymbolInfo.cc above #include <bfd.h>. I chose:

#define PACKAGE "libgrive" /* dummy to keep <bfd.h> happy */
#include <bfd.h>
#include <execinfo.h>
...

I don't understand a lot of the context around the binutils bug (except that just adding #include <config.h> above the include for bfd.h doesn't work), but this seems to be a benign workaround at least as long as binutils continues to behave in this way.