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

[BUG] mojo build failed because ld cannot find -lz -ltinfo #3517

Open
mackauto opened this issue Sep 21, 2024 · 3 comments
Open

[BUG] mojo build failed because ld cannot find -lz -ltinfo #3517

mackauto opened this issue Sep 21, 2024 · 3 comments
Assignees
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@mackauto
Copy link

Bug description

Just Following the Get Started Doc of Mojo, failed in the step 4 Build an executable binary.

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
    (hello) xxx@coding:~/mojo_exp/hello$ mojo build hello.mojo
    /usr/bin/ld: cannot find -lz: No such file or directory
    /usr/bin/ld: cannot find -ltinfo: No such file or directory
    collect2: error: ld returned 1 exit status
    mojo: error: failed to link executable
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.
    I try to set LD_LIBRARY_PATH to the project .magic lib path, like .magic/envs/default/lib, because the missing so files are there, but it didn't help.

System information

- What OS did you do install Mojo on ?
Operating System: Ubuntu 22.04.5 LTS
          Kernel: Linux 5.15.0-122-generic
    Architecture: x86-64
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 24.5.0 (e8aacb95)
- Provide Modular CLI version by pasting the output of `modular -v`
magic 0.3.0
- ld version
2.38
@mackauto mackauto added bug Something isn't working mojo-repo Tag all issues with this label labels Sep 21, 2024
@Moosems
Copy link

Moosems commented Sep 23, 2024

I got that issue as well. I run sudo apt-get install -y gcc g++ zlib1g-dev libtinfo-dev to install the dependencies that it has

@mackauto
Copy link
Author

I got that issue as well. I run sudo apt-get install -y gcc g++ zlib1g-dev libtinfo-dev to install the dependencies that it has

It worked. Thank you.

@linear linear bot assigned zbowling Oct 8, 2024
@Ivo-Balbaert
Copy link

I had the some problem starting from a brand-new Ubuntu 24 machine. The comment by @mackauto solved it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

4 participants