-
Notifications
You must be signed in to change notification settings - Fork 206
Error in vscode: "gcc.exe' failed in phase
C pre-processor'. (Exit code: 1)"
#1519
Comments
Hey, I got essentially the same error — but for a totally different reason. In my case, the project is pre-built and What trips
Which, if retried by hand, barfs:
There indeed appear no input-file arguments in that Thoughts? |
OK, I still don't know what I'm doing, but at least I understand why the preprocessor call is failing. This is apparently incorrect way to use
Correct call:
This hasn't changed any time recently (tested the same behavior across the 3 latest major releases of GCC: 8.4.0, 9.3.0, 10.1.0), and not a bug per
No primary source file -- nothing to process; fatal error. What's left is to understand where the preprocessor is invoked from. And why that code is trying to use Any hints appreciated. |
@jneira found that it happens on our install script project when you have never built it before.
Steps to reproduce:
or, if project is already cloned
where
code .
is just an arbitrary lsp-client.In the project
hie-install
, the cradleCabal-Helper-v2
will be selected due to the presence ofcabal.project
.Simply opening any haskell source file in the project will lead to the described error message.
Error is specifically that a
cabal_macros.h
can not be found, which is not generated when c-h initialises the project context.Workaround: use
stack build
andcabal build
respectively to generate this file.EDIT: adding a
hie.yaml
works for me as expected even when the project has never been built before.Originally posted by @fendor in mpickering#47 (comment)
Related issue haskell/cabal#2209.
The text was updated successfully, but these errors were encountered: