c2v icon indicating copy to clipboard operation
c2v copied to clipboard

Cannot translate DWM

Open ghost opened this issue 2 years ago • 16 comments

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.

ghost avatar Feb 17 '23 08:02 ghost

Hi @TenTypekMatus,

please read the Configuration section in the README

ArtemkaKun avatar Feb 17 '23 08:02 ArtemkaKun

Let me know if you will have any problems

ArtemkaKun avatar Feb 17 '23 08:02 ArtemkaKun

@ArtenkaKun Ok, I'll do that.

ghost avatar Feb 17 '23 08:02 ghost

Ah ok, excuse me, I understood your issue in a wrong way

ArtemkaKun avatar Feb 17 '23 08:02 ArtemkaKun

Can you please add a link to a code you want to translate?

ArtemkaKun avatar Feb 17 '23 08:02 ArtemkaKun

Sure. https://dwm.suckless.org/

ghost avatar Feb 17 '23 10:02 ghost

It's the most simple WM that exists.

ghost avatar Feb 17 '23 10:02 ghost

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?

ArtemkaKun avatar Feb 17 '23 10:02 ArtemkaKun

Here it is. (compiled w/ make) Screenshot from 2023-02-17 13-37-01

ghost avatar Feb 17 '23 12:02 ghost

Can you try to seak for this ftheader.h file on your computer, and then include it in C2V configuration with -I parameter?

ArtemkaKun avatar Feb 17 '23 12:02 ArtemkaKun

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.

ghost avatar Feb 17 '23 13:02 ghost

image Also, there's the image.

ghost avatar Feb 17 '23 13:02 ghost

Let me try it on my PC, one sec

ArtemkaKun avatar Feb 17 '23 13:02 ArtemkaKun

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?

ArtemkaKun avatar Feb 17 '23 13:02 ArtemkaKun

Maybe... ig.

ghost avatar Feb 17 '23 14:02 ghost

I think this issue should stay so we can fix it in the future

ArtemkaKun avatar Feb 17 '23 14:02 ArtemkaKun