-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add suggestions for "undefined reference" link errors #86558
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
If you get to the The |
You can add a test that will run only on Linux using the |
@petrochenkov I've adjusted the error message to recommend The problem with lacking tests goes beyond the output changing between systems -- it's possible that the user has a linker that uses a different error format on their system. While the current version of GCC |
Ok, looks like we don't need to consider arbitrary future, even LLD produces a different message now:
|
r=me after updating the wording and squashing commits. |
@bors r+ rollup |
📌 Commit ce63d55 has been approved by |
…laumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#86558 (Add suggestions for "undefined reference" link errors) - rust-lang#86616 (rustc_span: Explicitly handle crates that differ from package names) - rust-lang#86652 (Add support for leaf function frame pointer elimination) - rust-lang#86666 (Fix misleading "impl Trait" error) - rust-lang#86762 (mailmap: Add my work email address) - rust-lang#86773 (Enable the tests developed with rust-lang#86594) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This adds a suggestion for "undefined reference to ..." linking errors to install or specify the location to an external library. Since there is no defined error format for linkers, we just check if there was a failure and if that failure contains the string
undefined reference to
. This also makes it impossible to test this, since the output depends on the system linker. The output now looks like: