Questions tagged [clang]
19 questions
8
votes
2 answers
How can I set up clang-format in emacs?
When running clang-format-buffer or clang-format-region when a region has been been selected, no change is made to the formatting. However, in *Messages*, I see (clang-format: success). Using clang-format in the terminal works fine, and the emacs…

jidicula
- 251
- 4
- 12
5
votes
1 answer
How to use clang-format package?
I installed clang-format package from the MELPA repository.
I added it to the load-path in my init file.
Whenever I try to use it it says:
Searching for program: No such file or directory, clang-format
I would assume this is because I don't have…

Rtsne42
- 489
- 5
- 13
4
votes
1 answer
How to clang-format the current buffer on save?
Whats the best way to clang-format a C/C++/GLSL a buffer on save, that does nothing in the case there is no clang-format file found for a project?

ideasman42
- 8,375
- 1
- 28
- 105
3
votes
1 answer
How to make connection to arduino LSP server?
I came across this repo arduino-language-server.
My question is how to make it connect it to my emacs? (Maybe more generally, how to connect to any other LSP-server?)
Currently I've installed prerequisites, and can run it (as instructed on it's…

Garid
- 545
- 1
- 13
2
votes
0 answers
Flycheck c/c++-clang check linux kernel headers
Currently I am working with the linux kernel, but I am struggling trying to check my syntax using flycheck, I already added the path of the headers in the clang-path but it is not enough. Does any of you know how to properly analyze the files?…

user3347359
- 327
- 2
- 7
1
vote
1 answer
pdf-tools: could not determine link -lib interface
While trying to install pdf-tools on doom emacs (28.2) on Termux android, I get this error:
-*- mode: compilation; default-directory: "~/.emacs.d/.local/straight/build-28.2/pdf-tools/build/server/" -*-
Comint started at Mon Feb 13…

Abel
- 13
- 2
1
vote
1 answer
"No EmacSQL SQLite binary available" while running Org-Roam on GUIX
I'm struggling to set up Org-Roam on a minimal GUIX set-up. There is an attempt to compile Compiling EmacSQL SQL binary which throws an error No EmacSQL SQLite binary available. I have installed both gcc and clang and the correct path (ie. the same…

krozruch
- 13
- 5
1
vote
0 answers
LSP clangd + company-mode writes ${n: Variable} strings
I am not sure what exactly to google, on this issue. I have emacs 28.1 installed, with LSP-clangd and company-mode installed.
Suppose a function have signature int func(int i, int j), then emacs autocomplete it as
func(${1:int i}, ${2:int j}). What…

ipcamit
- 123
- 4
1
vote
0 answers
Suppress a warning in lsp-mode using clangd
Here's an example of code for which I get a warning when using lsp-mode, with clangd:
struct A {
union {
struct B {
int i;
} b;
};
};
The warning appears with a flycheck mark on the left, telling me that types cannot be declared…

Vultan
- 121
- 2
1
vote
0 answers
Structures are defined using a macro, flycheck gives errors
In our source code we surround structures with a macro (MKDIFF) that serves as a flag for the Makefile system. It does not expand into anything, just a flag. Flycheck (understandably) flags these structures as errors.
Here is an example:
typedef…

SFbay007
- 554
- 4
- 13
1
vote
1 answer
company-mode clang error
I am following this tutorial
When having enabled company-node upon typing for instance std::vec I get error message in the mini buffer saying:
clang failed with error 1:
/usr/bin/clang -fsyntax-only -Xclang -code-completion-macros -x c++ -Xclang…

lo tolmencre
- 169
- 6
1
vote
2 answers
customize the clang format
I know I can create a .clang-format file, and use this per project, but what I'd really like is a way to set the default clang-format style to one of the available formats, so I can experiment with various styles across various projects.
I would…

Spacemoose
- 877
- 1
- 7
- 18
0
votes
0 answers
"Error running timer file missing doing vfork" Emacs dap debug C++
I've c++ cmake project beginning-cpp20.
The project structure as as below -
$ tree .
.
├── CMakeLists.txt
├── launch.json
└── meetingcpp.cpp
The contents of CMakeLists.txt is -
cmake_minimum_required(VERSION 3.20)
project(BEGINING_CPP VERSION…

Rajkumar Natarajan
- 317
- 2
- 14
0
votes
1 answer
lsp mode problems: not enabled, and clangd include file not found
I am trying to configure lsp-mode with clangd using emacs 28.1 (compiled from source), and encounter two problems that I do not manage to solve:
First, `lsp-mode` is not started automatically when I open a c++ source file. The loaded major-mode is…

user52366
- 131
- 5
0
votes
1 answer
How to disable lsp-clangd server if there is no dominating compile_commands.json
I've got lsp mode, projectile mode, and flymake modes, working pleasantly for C++ running using a clangd language server. However, I have many, many directories that (at least for now) do not have compile_commands.json files in a dominating…

bgoodr
- 339
- 2
- 12