xlab / c-for-go

Automatic C-Go Bindings Generator for Go Programming Language
https://c.for-go.com
MIT License
1.5k stars 119 forks source link

panic: unknown type _Float128 #144

Closed maxsupermanhd closed 1 year ago

maxsupermanhd commented 1 year ago

I am trying to make a binding for library cubiomes but if I include quadbase.h this happens:

panic: unknown type _Float128

goroutine 1 [running]:
github.com/xlab/c-for-go/translator.(*Translator).typeSpec(0x0?, {0x81db38, 0xc000e27dc0}, {0xc0014a33c0, 0x7}, 0x2, 0x0, 0x0)
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/ast_walker.go:425 +0xe06
github.com/xlab/c-for-go/translator.(*Translator).functionSpec(0x81d958?, 0xc001281a90, {0x81d958?, 0xc000f57570}, {0xc0014a33b0, 0x10}, 0x0, 0x1)
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/ast_walker.go:284 +0x476
github.com/xlab/c-for-go/translator.(*Translator).typeSpec(0xc000108540?, {0x81d958, 0xc000f57570}, {0xc0014a33b0, 0x10}, 0x0, 0x0, 0x0)
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/ast_walker.go:408 +0x7b5
github.com/xlab/c-for-go/translator.(*Translator).declarator(0x1400?, {0x81d958?, 0xc000f57570?}, {0xc0014a33b0, 0x10}, 0x0, 0x0, 0xb1?, {{0xc000108540, 0x3f}, ...})
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/ast_walker.go:95 +0x56
github.com/xlab/c-for-go/translator.(*Translator).walkDeclaration(0xc0008bd590, 0xc00093a960)
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/ast_walker.go:58 +0x7b5
github.com/xlab/c-for-go/translator.(*Translator).walkExternalDeclaration(0xc0008bd590, 0xc000b7c040)
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/ast_walker.go:38 +0x1d3
github.com/xlab/c-for-go/translator.(*Translator).walkTranslationUnit(...)
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/ast_walker.go:13
github.com/xlab/c-for-go/translator.(*Translator).Learn(0xc0008bd590, 0xc000e3a8c0)
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/translator/translator.go:290 +0x38
main.NewProcess({0x7ffcd72fbf85, 0xc}, {0x0, 0x0})
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/process.go:96 +0x41b
main.main()
    /home/max/go/pkg/mod/github.com/xlab/c-for-go@v0.0.0-20221118134302-231d72d2aa87/main.go:80 +0x238
l0rem1psum commented 1 year ago

I encountered the same issue while creating a binding for FFmpeg. Tried various configurations but nothing works. Hopefully this can be addressed soon.

xlab commented 1 year ago

should be solved in https://github.com/xlab/c-for-go/pull/156