Closed muteb closed 3 years ago
Hi,
Thanks for submitting this issue. The problem is probably the location of your yara.h file.
YARA_INCLUDE_DIR
to the directory containing the yara.h file. You may have to clean the yara-src build output first with cargo clean -p yara-src
For example:
> ls /usr/include/yara.h
/usr/include/yara.h
> cargo clean -p yara-sys
> export YARA_INCLUDE_DIR=/usr/include
> cargo build
If this doesn't work, maybe use the vendored
feature of yara-rust.
Hi, Thank youv ery much . I added the dir to the environment and it found the yara.h file, however, I run into another issue:
Compiling yara-sys v0.4.2 (C:\Users\****\Desktop\yara-rust\yara-rust\yara-sys)
error[E0412]: cannot find type `YR_ARENA` in this scope
--> C:\Users\****\Desktop\yara-rust\yara-rust\target\debug\build\yara-sys-6a2f9b3efd5af1e9\out/bindings.rs:4807:21
|
4807 | pub arena: *mut YR_ARENA,
| ^^^^^^^^ not found in this scope
error[E0412]: cannot find type `YR_ARENA` in this scope
--> C:\Users\****\Desktop\yara-rust\yara-rust\target\debug\build\yara-sys-6a2f9b3efd5af1e9\out/bindings.rs:5875:21
|
5875 | arena: *mut YR_ARENA,
| ^^^^^^^^ not found in this scope
error[E0609]: no field `__bindgen_anon_1` on type `&YR_MATCHES`
--> yara-sys\src\lib.rs:40:23
|
40 | unsafe { self.__bindgen_anon_1.head }
| ^^^^^^^^^^^^^^^^ unknown field
|
= note: available fields are: `head`, `tail`, `count`
error[E0609]: no field `__bindgen_anon_2` on type `&YR_MATCHES`
--> yara-sys\src\lib.rs:44:23
|
44 | unsafe { self.__bindgen_anon_2.tail }
| ^^^^^^^^^^^^^^^^ unknown field
|
= note: available fields are: `head`, `tail`, `count`
error[E0609]: no field `identifier` on type `YR_STRING__bindgen_ty_1`
--> yara-sys\src\lib.rs:88:40
|
88 | unsafe { self.__bindgen_anon_1.identifier }
| ^^^^^^^^^^ unknown field
|
= note: available fields are: `string`, `string_`, `_bindgen_union_align`
error[E0609]: no field `string` on type `YR_STRING__bindgen_ty_2`
--> yara-sys\src\lib.rs:92:40
|
92 | unsafe { self.__bindgen_anon_2.string as _ }
| ^^^^^^ unknown field
|
= note: available fields are: `chained_to`, `chained_to_`, `_bindgen_union_align`
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0412, E0609.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `yara-sys`
Do I need to use certain version of LLM or yaralib?
Thanks alot.
I think you may be using yara v4.0. For now, this library only supports yara up to 3.11. You may use the vendored feature to automatically download and build Yara 3.11.
Le ven. 19 mars 2021 à 11:50, muteb alqahtani @.***> a écrit :
Hi, Thank youv ery much . I added the dir to the environment and it found the yara.h file, however, I run into another issue:
Compiling yara-sys v0.4.2 (C:\Users**\Desktop\yara-rust\yara-rust\yara-sys) error[E0412]: cannot find type
YR_ARENA
in this scope --> C:\Users**\Desktop\yara-rust\yara-rust\target\debug\build\yara-sys-6a2f9b3efd5af1e9\out/bindings.rs:4807:21 | 4807 | pub arena: *mut YR_ARENA, | ^^^^^^^^ not found in this scopeerror[E0412]: cannot find type
YR_ARENA
in this scope --> C:\Users***\Desktop\yara-rust\yara-rust\target\debug\build\yara-sys-6a2f9b3efd5af1e9\out/bindings.rs:5875:21 | 5875 | arena: mut YR_ARENA, | ^^^^^^^^ not found in this scope
error[E0609]: no field __bindgen_anon_1
on type&YR_MATCHES
--> yara-sys\src\lib.rs:40:2340 unsafe { self.__bindgen_anon_1.head } ^^^^^^^^^^^^^^^^ unknown field = note: available fields are:
head
,tail
,count
error[E0609]: no field __bindgen_anon_2
on type&YR_MATCHES
--> yara-sys\src\lib.rs:44:2344 unsafe { self.__bindgen_anon_2.tail } ^^^^^^^^^^^^^^^^ unknown field = note: available fields are:
head
,tail
,count
error[E0609]: no field identifier
on typeYR_STRING__bindgen_ty_1
--> yara-sys\src\lib.rs:88:4088 unsafe { self.__bindgen_anon_1.identifier } ^^^^^^^^^^ unknown field = note: available fields are:
string
,string_
,_bindgen_union_align
error[E0609]: no field string
on typeYR_STRING__bindgen_ty_2
--> yara-sys\src\lib.rs:92:4092 unsafe { self.__bindgen_anon2.string as } ^^^^^^ unknown field = note: available fields are:
chained_to
,chained_to_
,_bindgen_union_align
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0412, E0609. For more information about an error, try
rustc --explain E0412
. error: could not compileyara-sys
Do I need to use certain version of LLM or yaralib?
Thanks alot.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Hugal31/yara-rust/issues/15#issuecomment-802735711, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFGRU4X5U3TJY5RP3IO4UDTEMT6XANCNFSM4ZNXIAJQ .
thank you very vary much. I managed to use yara3.11 and it works like a charm.
Hi Hugel31,
when I do the cargo build, it works fine without any problem but when I try the cargo test, it return "error: linking with link.exe
failed: exit code: 1181" although I have vs C++ tools installed and had compiled other project before. I'm wondering what chaintool do you use "stable-i686-pc-windows-msvc" or "stable-x86_64-pc-windows-gnu"?
Thanks,
Mmmh, I wish link.exe was more verbose. I am not familiar with build on Windows, but I assume it didn't find the library. As you did with the header, locate yara.dll
(or yara.lib
), and set the YARA_LIBRARY_PATH
environment variable directly to the file (or is it to the directory ?). Run cargo clean -p yara-sys
before that.
Sorry if that doesn't work, but I rarely code on Windows.
Alternatively, try the vendored
feature of yara-rust.
worked like a charm. I set the YARA_LIBRARY_PATH to point to the yara.lib and compile it again and it workd fine.. thanks alot.
Hi,
Thank you very much for creating this awesome crate. I add the yara crate to the toml and compile it but I faced this error.
Is there a way to solve this issue!
Thanks.