You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
externcrate test_1_lib;fnmain(){// Uncomment this function call to make linking succeed:// test_1_lib::some_function();vec![0u8; test_1_lib::SOME_VALUE.some_member];}
git clone https://github.com/briansmith/rust-bug-2
cd bin
cargo build
Linking fails with:
test_1_bin.0.o : error LNK2019: unresolved external symbol __imp__ZN10SOME_VALUE20hc1593d2370c9bbcfiaaE referenced in fu
nction _ZN4main20hf3c40dca13f06b85faaE
C:\<REDACTED>\test_1_bin.exe : fatal error LNK1120: 1 unresolved externals
Notice that the program only uses a static variable, and no functions, from the
library crate. If you uncomment the function call in bin/src/test_1_bin.rs then linking succeeds.
@briansmith when testing on beta/stable, are you sure you used the right compiler? This should have been fixed by #28646 which is present on both the beta/stable compilers, and I have verified myself that the x86_64-pc-windows-msvc beta/stable compilers work where the stable one does not. If it's still broken for you, though, that sounds like a problem!
@briansmith when testing on beta/stable, are you sure you used the right compiler?
I guess you mean "beta/nightly" everywhere you wrote "beta/stable."
I did not test beta. I did test an old 1.4 nightly that failed. But, guess I did not properly test the current 1.5 nightly, because I just tried again and it succeeds. So, I think that this is fixed in Nightly 1.5 based on my testing. Again, I did not test the 1.4 beta.
Program:
test_1_lib:
The full test case is available at https://github.com/briansmith/rust-bug-2.
To reproduce:
Linking fails with:
Notice that the program only uses a static variable, and no functions, from the
library crate. If you uncomment the function call in
bin/src/test_1_bin.rs then linking succeeds.
Reproduced with (on x86_64-pc-windows-msvc):
The text was updated successfully, but these errors were encountered: