Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when getting go-yara #61

Closed
Xumeiquer opened this issue Mar 27, 2020 · 1 comment
Closed

Error when getting go-yara #61

Xumeiquer opened this issue Mar 27, 2020 · 1 comment

Comments

@Xumeiquer
Copy link

I have a fresh Debian box with the latest version of Yara (3.11) as well as Golang which is 1.14.1. When running go get github.com/hillu/go-yara I get the following output:

go install github.com/hillu/go-yara
# github.com/hillu/go-yara
../go/src/github.com/hillu/go-yara/rule.go:144:8: could not determine kind of name for C.META_TYPE_NULL
../go/src/github.com/hillu/go-yara/rule.go:193:27: could not determine kind of name for C.RULE_GFLAGS_GLOBAL
../go/src/github.com/hillu/go-yara/rule.go:188:27: could not determine kind of name for C.RULE_GFLAGS_PRIVATE
cgo: 
gcc errors for preamble:
../go/src/github.com/hillu/go-yara/rule.go: In function 'string_matches':
../go/src/github.com/hillu/go-yara/rule.go:81:36: error: macro "yr_string_matches_foreach" requires 3 arguments, but only 2 given
  yr_string_matches_foreach(s, match) {
                                    ^
../go/src/github.com/hillu/go-yara/rule.go:81:2: error: 'yr_string_matches_foreach' undeclared (first use in this function); did you mean 'string_matches'?
  yr_string_matches_foreach(s, match) {
  ^~~~~~~~~~~~~~~~~~~~~~~~~
  string_matches
../go/src/github.com/hillu/go-yara/rule.go:81:2: note: each undeclared identifier is reported only once for each function it appears in
../go/src/github.com/hillu/go-yara/rule.go:81:27: error: expected ';' before '{' token
  yr_string_matches_foreach(s, match) {
                           ^          ~
                           ;

By running pkg-config I get the following:

pkg-config --libs yara
-L/usr/local/lib -lyara
pkg-config --cflags yara
-DUSE_LINUX_PROC -pthread -DMAGIC_MODULE -DHASH_MODULE -I/usr/local/include

Any ideas?

@hillu
Copy link
Owner

hillu commented Mar 27, 2020

Apparently, you are not using YARA 3.11 but a pre-release version of YARA 4.0.0 from Github (master). If you switch to the version tagged as v3.11.0, you should find that everything builds just fine.

@hillu hillu closed this as completed Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants