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

vlib OS error: undefined ident: autofree #21304

Closed
joysahimar opened this issue Apr 18, 2024 · 2 comments
Closed

vlib OS error: undefined ident: autofree #21304

joysahimar opened this issue Apr 18, 2024 · 2 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@joysahimar
Copy link

joysahimar commented Apr 18, 2024

Describe the bug

i'm using import os in my project, but getting error: undefined ident: autofree

Reproduction Steps

Simple Code:

import os

fn main() {
	println(os.environ())
}

Expected Behavior

No Error

Current Behavior

/home/joycomp/vlang/v/vlib/os/os.c.v:542:8: error: undefined ident: `autofree`
  540 |         str := unsafe { tos(&u8(buf), if nr_chars < 0 { 0 } else { nr_chars }) }
  541 |         ret := str.clone()
  542 |         $if !autofree {
      |              ~~~~~~~~
  543 |             unsafe {
  544 |                 if nr_chars > 0 && buf != 0 {
/home/joycomp/vlang/v/vlib/os/os.c.v:542:7: error: unknown var: `autofree`
  540 |         str := unsafe { tos(&u8(buf), if nr_chars < 0 { 0 } else { nr_chars }) }
  541 |         ret := str.clone()
  542 |         $if !autofree {
      |             ^
  543 |             unsafe {
  544 |                 if nr_chars > 0 && buf != 0 {
If the code of your project is in multiple files, try with `v .` instead of `v test.v`

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.5 e6b43a1

Environment details (OS name and version, etc.)

Same error when v doctor

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@joysahimar joysahimar added the Bug This tag is applied to issues which reports bugs. label Apr 18, 2024
@JalonSolov
Copy link
Contributor

Looks like you just need to update your V. This example works with V 0.4.5 0f5da89

@joysahimar
Copy link
Author

I tried v up still the same error. maybe I'll try clone and make again. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

2 participants