gcc-python-plugin icon indicating copy to clipboard operation
gcc-python-plugin copied to clipboard

auto-host.h not found

Open thealberto opened this issue 7 years ago • 6 comments

Hi, I'm trying to compile the project on my Linux machine running gcc 6.3.0 and with python and six installed but I had the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/gcc/x86_64-linux-gnu/6/plugin/include/auto-host.h'

Any idea on how to fix it please?

Thanks

thealberto avatar Nov 13 '17 19:11 thealberto

Looks like output from generate-config-h.py

Is there more output than that? Can you post the full log please?

davidmalcolm avatar Nov 13 '17 20:11 davidmalcolm

Hi @davidmalcolm , sure that's the full output:

➜  gcc-python-plugin git:(master) make
Makefile:193: warning: overriding recipe for target 'autogenerated-casts.c'
Makefile:190: warning: ignoring old recipe for target 'autogenerated-casts.c'
python generate-config-h.py -o autogenerated-config.h --gcc="cc" --plugindir="/usr/lib/gcc/x86_64-linux-gnu/6/plugin"
Checking whether cc was built with C or C++... Traceback (most recent call last):
  File "generate-config-h.py", line 125, in <module>
    ch.main()
  File "generate-config-h.py", line 44, in main
    self.test_whether_built_with_cplusplus()
  File "generate-config-h.py", line 93, in test_whether_built_with_cplusplus
    with open(auto_host_h, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/gcc/x86_64-linux-gnu/6/plugin/include/auto-host.h'
Makefile:177: recipe for target 'autogenerated-config.h' failed
make: *** [autogenerated-config.h] Error 1

So the plugin dir exist but the include dir does not so obviously also the .h does not.

Any idea?

Thanks

thealberto avatar Nov 13 '17 22:11 thealberto

Aha: looks like the plugin includes are missing.

Thanks.

Is the gcc 6 installed via a package manager (e.g. apt/.deb or rpm/yum/dnf)? If so, maybe there's another package you need to install. On Fedora/RHEL I believe it's "gcc-plugin-devel".

We should probably provide a better error message for this.

davidmalcolm avatar Nov 14 '17 14:11 davidmalcolm

@davidmalcolm , how did I miss that? :)

I had to install gcc-6-plugin-dev, my suggestion is to update the README file on github.

Update: Installing it I have now this error:

gcc-location.c: In function ‘gcc_location gcc_location_get_caret(gcc_location)’:
gcc-location.c:68:65: error: ‘get_pure_location’ was not declared in this scope
   return gcc_private_make_location (get_pure_location (loc.inner));

I'll try to find the solution...

Thanks

thealberto avatar Nov 14 '17 19:11 thealberto

That one looks like a dup of issue #112.

davidmalcolm avatar Dec 03 '17 00:12 davidmalcolm

FYI, on Ubuntu "auto-host.h not found" is solved by installing the gcc-X-plugin-dev package for the right gcc version.

dvarrazzo avatar Dec 28 '18 12:12 dvarrazzo