Skip to content

Rust requires an installed C compiler for linking, but book never mentions this is necessary #32208

New issue

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

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

Already on GitHub? # to your account

Closed
niconii opened this issue Mar 12, 2016 · 8 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@niconii
Copy link
Contributor

niconii commented Mar 12, 2016

From what I understand, Rust executes cc for linking programs. However, the book doesn't mention that a C compiler needs to be installed before installing Rust, resulting in a confusing error along these lines when one attempts to compile a Rust program:

error: could not exec the linker `cc`: No such file or directory (os error 2)
@retep998
Copy link
Member

Also note this does depend on the specific target you're using. windows-gnu for example bundles the linker and such so it is completely standalone for pure Rust code while windows-msvc depends on having MSVC installed.

@dustinlapierre
Copy link

I'm a beginner looking for a good entry level issue to work on and this one caught my eye. What kind of details are needed in the documentation surrounding this issue?

@steveklabnik
Copy link
Member

@dustinlapierre sorry for taking a while to get back to you. Basically, a note should be added in https://github.com/rust-lang/rust/blob/master/src/doc/book/getting-started.md to mention that you will need a c compiler installed. The bits @retep998 mentioned should be the only exception to that rule, as far as I know.

@steveklabnik steveklabnik added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Jun 27, 2016
@steveklabnik
Copy link
Member

I would be happy to work with anyone who wants to tackle this issue.

@steveklabnik steveklabnik added the E-help-wanted Call for participation: Help is requested to fix this issue. label Jun 27, 2016
@wezm
Copy link
Member

wezm commented Jul 9, 2016

This detail is already in the the Getting Started guide: 6c56260 perhaps it needs to be called out more prominently under the Installing on Linux or Mac and Installing on Windows sections? If so I'm happy to have a go.

@retep998
Copy link
Member

retep998 commented Jul 9, 2016

For what it's worth, on windows-msvc rustc at least prints out a nicer message telling you that you need to get MSVC. https://github.com/rust-lang/rust/blob/master/src/librustc_trans/back/link.rs#L690-L695

@steveklabnik
Copy link
Member

@wezm yes, I think that'd be good. Thanks!

@pmatos
Copy link
Contributor

pmatos commented Sep 23, 2016

I just noticed, I did not reference the Mac on my pull request. Does anyone know what the situation is on the Mac regarding Linker requirements?

sophiajt pushed a commit to sophiajt/rust that referenced this issue Sep 28, 2016
Improve documention troubleshooting missing linker. Fix rust-lang#32208.

@steveklabnik is this in the direction on how you want to see rust-lang#32208 fixed?
@bors bors closed this as completed in cb3b03c Sep 29, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

7 participants