I needed to specify stdlib options in a certain environment, so I changed the flycheck executable to clang -std=c++11 -stdlib=libc++, which is needed to compile the file.

However, I got the error Error while checking syntax automatically: (error "Output file descriptor of flycheck-c/c++-clang is closed") after doing so, and searches don't turn anything up.

How do I help flycheck out?


You don't change the executable, but rather modify flycheck's variables that get translated into a command. In your case, you have to change them like:

(setq flycheck-clang-language-standard "c++11")
(setq flycheck-clang-standard-library "libc++")

You can also customize these variables (by running M-x customize-variable)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.