elliotchance / c2go

⚖️ A tool for transpiling C to Go.
MIT License
2.07k stars 154 forks source link

Error: preprocess for file: [prime.c] failed: exec: "clang": executable file not found in %PATH% StdErr = #824

Open Huwaiza opened 5 years ago

Huwaiza commented 5 years ago

My file is not being converted to .go Error: preprocess for file: [prime.c] failed: exec: "clang": executable file not found in %PATH% StdErr =

elliotchance commented 5 years ago

You will need to have [clang installed](https://clang.llvm.org. Clang is a C compiler and does the parsing of the source files and produces an AST that can be understood by c2go.

Huwaiza commented 5 years ago

Installed it but still was showing errors even on the programs you gave as an example

On Mon, Apr 15, 2019 at 4:18 AM Elliot Chance notifications@github.com wrote:

You will need to have [clang installed](https://clang.llvm.org. Clang is a C compiler and does the parsing of the source files and produces an AST that can be understood by c2go.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/elliotchance/c2go/issues/824#issuecomment-483067185, or mute the thread https://github.com/notifications/unsubscribe-auth/Am4GJjMgm5ETitdOqAuqb2pmwImy1p_Xks5vg7dUgaJpZM4cuo2x .

elliotchance commented 5 years ago

Please include the errors in the issue.

Huwaiza commented 5 years ago

It's fib.c panic: could not match regexp with string ^(?P

[0-9a-fx]+) <(?P.)> '(?P.?)'(:'(?P.)')?(?P lvalue)?(?P prefix)?(?P postfix)? '(?P.?)'[\s]$ 0x1c586fd7950 <col:14, col:44> 'unsigned long long' lvalue prefix '' cannot overflow

goroutine 52 [running]: github.com/elliotchance/c2go/ast.groupsFromRegex(0xc0000346e0 http://github.com/elliotchance/c2go/ast.groupsFromRegex(0xc0000346e0, 0xa6, 0xc0005733bc, 0x55, 0x3d)

  • C:/Users/huwai/OneDrive/Documents/GitHub/c2go/ast/ast.go:286 +0x364 github.com/elliotchance/c2go/ast.parseUnaryOperator(0xc0005733bc http://github.com/elliotchance/c2go/ast.parseUnaryOperator(0xc0005733bc, 0x55, 0x6c9de1)*
  • C:/Users/huwai/OneDrive/Documents/GitHub/c2go/ast/unary_operator.go:16 +0x69 github.com/elliotchance/c2go/ast.Parse(0xc0005733ae http://github.com/elliotchance/c2go/ast.Parse(0xc0005733ae, 0x63, 0x6c564d, 0x5)*

  • C:/Users/huwai/OneDrive/Documents/GitHub/c2go/ast/ast.go:246 +0x21e5 main.convertLinesToNodes(0xc0000d8260, 0x627, 0x1275, 0x20646574726f7070, 0x6320656874207962, 0x6320746e65727275)*
  • C:/Users/huwai/OneDrive/Documents/GitHub/c2go/main.go:89 +0x1cf main.convertLinesToNodesParallel.func1.2(0xc0003260c0, 0xc00031e000, 0xc0000d8260, 0x627, 0x1275, 0x0)*
  • C:/Users/huwai/OneDrive/Documents/GitHub/c2go/main.go:121 +0x5a created by main.convertLinesToNodesParallel.func1*
  • C:/Users/huwai/OneDrive/Documents/GitHub/c2go/main.go:119 +0x1ad*

On Mon, Apr 15, 2019 at 8:01 AM Elliot Chance notifications@github.com wrote:

Please include the errors in the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/elliotchance/c2go/issues/824#issuecomment-483091854, or mute the thread https://github.com/notifications/unsubscribe-auth/Am4GJv5FLm6__VzydAUBgnteE8LFGbdRks5vg-uRgaJpZM4cuo2x .

elliotchance commented 5 years ago

That error is caused by c2go not being able to understand the output from clang.

Unfortunately, you are seeing this because no windows distributions are part of the CI pipeline. They are less thoroughly tested than the Linux version.

You can have a go at fixing this by covering the case by following this example: https://github.com/elliotchance/c2go/pull/760/files

Konstantin8105 commented 5 years ago

Please try https://github.com/Konstantin8105/c4go

Huwaiza commented 5 years ago

Thanks but i have already done it manually

On Mon, Apr 22, 2019 at 5:26 PM Konstantin notifications@github.com wrote:

Please try https://github.com/Konstantin8105/c4go

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/elliotchance/c2go/issues/824#issuecomment-485406028, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXAMJV7TQMFDJQQKIGVTXTPRWVH3ANCNFSM4HF2RWYQ .

AvinashRamashray commented 4 years ago

@Huwaiza

Please post the fix here for this issue... I am also getting exactly same issue....