c2v
c2v copied to clipboard
Cannot translate DWM
Hi. I downloaded dwm source code from their git repo, compiled c2v and then ran it. But when I ran it, I got this:
dwm on master via C v12.2.1-gcc
❯ ../c2v/c2v .
C to V translator 0.3.1
"." is a directory, processing all C files in it recursively...
translating ./drw.c ... In file included from ./drw.c:6:
In file included from /usr/include/X11/Xft/Xft.h:40:
./ft2build.h:37:10: fatal error: 'freetype/config/ftheader.h' file not found
#include <freetype/config/ftheader.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
The file ./drw.c could not be parsed as a C source file.
Hi @TenTypekMatus,
please read the Configuration section in the README
Let me know if you will have any problems
@ArtenkaKun Ok, I'll do that.
Ah ok, excuse me, I understood your issue in a wrong way
Can you please add a link to a code you want to translate?
Sure. https://dwm.suckless.org/
It's the most simple WM that exists.
Ok, so drw.c imports Xft.h, which imports freetype/config/ftheader.h header file. For some reasons, C2V has problems with it.
Can you try to compile dwm on your PC and make sure it works as intended?
Here it is. (compiled w/ make)

Can you try to seak for this ftheader.h file on your computer, and then include it in C2V configuration with -I parameter?
Sure. I had to pass those args manually since c2v didn't detect config.toml, and now it says that I don't have permission to open the file. I tried it with sudo, but now, it gave me this:
dwm on master [!?] via C v12.2.1-gcc
❯ sudo c2v . -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os -I /usr/X11R6/include -I /usr/i
nclude/freetype2 -I /usr/include/freetype2/ft2build.h
C to V translator 0.3.1
translating /usr/include/freetype2/ft2build.h ... /usr/include/freetype2/ft2build.h:37:10: error: 'freetype/config/ftheader.h' file not found with <angled> include; use "quotes" instead
#include <freetype/config/ftheader.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
"freetype/config/ftheader.h"
1 error generated.
The file /usr/include/freetype2/ft2build.h could not be parsed as a C source file.
Also, there's the image.
Let me try it on my PC, one sec
Ok, I can reproduce it. So, it's a bug and it needs to be resolved. Unfortunately, I have no time for C2V right now, maybe you can try to resolve it?
Maybe... ig.
I think this issue should stay so we can fix it in the future