Comments (9)
Linker error 1120 means some symbols have not been found. I don't have a 32-bit Windows right now so I can't reproduce. Can you post the full error message?
from winsafe.
F:\dev\rust\hello-winsafe>cargo run
Compiling hello-winsafe v0.1.0 (F:\dev\rust\hello-winsafe)
Compiling winsafe v0.0.9 (https://github.com/rodrigocfd/winsafe#70033e53)
error: linking with link.exe
failed: exit code: 1120
|
= note: "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\x86\link.exe" "/NOLOGO" "/LARGEADDRESSAWARE" "/SAFESEH" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.10ghu8o74bgh48mi.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.174r60i3udm7b0zg.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.19zgtn2pjaadwgmf.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.1fi6rlqp4fdokbvo.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.1m7obc51spagihjz.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.1mykcwv7kpkezhga.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.1wo24a46s6qg49nd.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.1xo0juqvlpxx1b3v.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.226vk6davw54322a.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.28r9yfcd91eqgw61.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.2gqk6jv3f0kty8q1.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.2h30phfdkn4q3e8y.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.2im636bym6v6yu7v.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.2lzlqrfrqloxirto.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.35wb24q72svi3dz5.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.3ivgm7u97pax4v5k.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.3pb4hc59jmz5v9uc.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.3qxtcuyx3xcod6bz.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.3v2d9js85lj8q6id.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.41pnpv0pjs0acylb.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.48d57fhjk1109lea.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.4a9c7n7kwwopz5h.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.4drlyyxgm5hcauph.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.4fn8m3c5p2ea2gjl.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.4lc3mff6ct2hznez.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.4lhlfuu9w43h1xxi.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.4lxdai69zfts8f7h.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.4ujicyfaut56oezr.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.50dhy5he0ri4t5v5.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.529604s5umqbsiak.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.547we53liiy2g4nb.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.54h6nq1mecuayp4x.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.57qr4x1bfl5pj0wx.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.59pc8ys3twqn1l5l.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.5ar4dabmrsnwmhx.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.5ardcbl5b2t5j7q8.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.5dlov15pne9gy5pp.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.q3p310qql5fvktj.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.sh368zrje8zbd13.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.teeyei2b990x3x8.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.zx41yuusad2z7bc.rcgu.o" "F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.3euc4kyo1rlpt3b4.rcgu.o" "/LIBPATH:F:\dev\rust\hello-winsafe\target\debug\deps" "/LIBPATH:C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib" "res/test.res.lib" "F:\dev\rust\hello-winsafe\target\debug\deps\libwinsafe-38e4adef7712f1bc.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libstd-b7ed9a298a4e2b46.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libpanic_unwind-d2d21c7563c84c5b.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\librustc_demangle-7a0376c48e722ad1.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libstd_detect-d427f1fb20a14f25.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libhashbrown-01902b9b46076235.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\librustc_std_workspace_alloc-45a8ca25374063ce.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libunwind-13a46253bfaf83bf.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libcfg_if-a0e732dc0e54ba58.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\liblibc-6b37ed2ae4cb6719.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\liballoc-0070102cb100b3c4.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\librustc_std_workspace_core-81deb8d5e56426b0.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libcore-67b03538091ef3f2.rlib" "C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib\libcompiler_builtins-c3b7c5f5e89efe00.rlib" "comctl32.lib" "gdi32.lib" "kernel32.lib" "ole32.lib" "shell32.lib" "shlwapi.lib" "user32.lib" "uxtheme.lib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\i686-pc-windows-msvc\lib" "/OUT:F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\stable-i686-pc-windows-msvc\lib\rustlib\etc\libstd.natvis"
= note: libwinsafe-38e4adef7712f1bc.rlib(winsafe-38e4adef7712f1bc.winsafe.e30a4dba-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol __imp__GetWindowLongPtrW@8 referenced in function __ZN7winsafe4user7handles4hwnd8UserHwnd16GetWindowLongPtr17hc6f51ba0ad00682aE
libwinsafe-38e4adef7712f1bc.rlib(winsafe-38e4adef7712f1bc.winsafe.e30a4dba-cgu.3.rcgu.o) : error LNK2019: unresolved external symbol __imp__SetWindowLongPtrW@12 referenced in function __ZN7winsafe4user7handles4hwnd8UserHwnd16SetWindowLongPtr17h41371fa95c01e7a7E
libwinsafe-38e4adef7712f1bc.rlib(winsafe-38e4adef7712f1bc.winsafe.e30a4dba-cgu.10.rcgu.o) : error LNK2019: unresolved external symbol __imp__MapViewOfFile@24 referenced in function __ZN7winsafe6kernel7handles8hfilemap14KernelHfilemap13MapViewOfFile17h7d502e23bc5c5d1cE
libwinsafe-38e4adef7712f1bc.rlib(winsafe-38e4adef7712f1bc.winsafe.e30a4dba-cgu.10.rcgu.o) : error LNK2019: unresolved external symbol __imp__InSendMessageEx@0 referenced in function __ZN7winsafe4user5funcs15InSendMessageEx17hee713d263419ef6aE
libwinsafe-38e4adef7712f1bc.rlib(winsafe-38e4adef7712f1bc.winsafe.e30a4dba-cgu.10.rcgu.o) : error LNK2019: unresolved external symbol __imp__IsThemeDialogTextureEnabled@0 referenced in function __ZN7winsafe7uxtheme5funcs27IsThemeDialogTextureEnabled17h009af2c9b8cbc53cE
F:\dev\rust\hello-winsafe\target\debug\deps\hello_winsafe.exe : fatal error LNK1120: 5 unresolved externals
error: could not compile hello-winsafe
due to previous error
F:\dev\rust\hello-winsafe>
from winsafe.
gui apps made with winsafe don't run on windows 7.
by the way, I love this library, the best one I used. thank you for this :)
from winsafe.
I installed the x32 toolchain on my development machine and I was able to reproduce the linker errors. I pushed a few commits fixing them, and it's working for me now.
I'm closing the issue, but let me know if it's working for you.
from winsafe.
Hi @rodrigocfd
my small WinSafe projects now compile beautifully without any warnings or errors, thank you so much for fixing it.
there's only one tiny little bit of problem, the compiled apps run well in win7 x64 but they don't work on win7 x86.
I don't know what the problem is, both win7 VMs (x64 and x86) have the same kind of updates installed on them. and both are missing the Platform Update for Windows 7 which I assume is not a requirement for the GUI part of WinSafe since Win32 GUI is an ancient tech.
running GUI apps in x86 is important for me because my little tools need to run on 30+ Win7 x86 machines at work.
if that is not possible to fix I can understand that. Thank you so much @rodrigocfd I love your work.
from winsafe.
Try to run the simplest possible program:
fn main() {
use winsafe::{self as w, co};
use w::prelude::*;
w::HWND::NULL.MessageBox("All good.", "Hello", co::MB::ICONINFORMATION).unwrap();
}
Then two situations may happen:
-
The program runs. It probably means that, in you actual program, you're calling an API which is not available in Win7, and it somehow blocks your program from running. Then you'd have to find which API is it, and there's no easy way, you'd have to test one by one.
-
The program doesn't run. It probably means the toolchain is generating an incompatible executable. You'd have to use the Rust toolchain with a compatible compiler, which is something I have no idea how to do. You'd have to ask in the Rust forum.
Anyway it's nothing an easy problem to fix. No one wants to support Win7 anymore.
from winsafe.
Hi @rodrigocfd
Is this related to unsupported API?
OS: Win7 x86
from winsafe.
Yep, SetUserObjectInformation
is throwing an error for some reason.
This call is being used for additional safety on SetTimer
calls. If you're not doing anything crazy with SetTimer
(like capturing native exceptions), it's not really needed. Try removing it and see if your program runs.
from winsafe.
Thanks @rodrigocfd
FYI it's just straight dialog box with a button and edit text in it, no fancy API calls or anything, just GUI code doesn't run. MessageBox alone works though, but simple dialog box with controls doesn't run.
Win11 x64 -> works
Win7 x86 -> doesn't work
from winsafe.
Related Issues (20)
- validate_retrieved_reg_val always fails
- [Question] - Calling windows APIs twice best practice HOT 3
- RegQueryValueEx returning TRANSACTION_REQUEST_NOT_VALID for valid data HOT 6
- nm_custom_draw should provide a mutable reference? HOT 6
- How do you envision WM_USER being used? HOT 1
- `WC::NoValue`? HOT 1
- I don't think `MultiByteToWideChar` and `WideCharToMultiByte` need to add 1 to `num_bytes` HOT 4
- resizable_layout not work as expect HOT 8
- When the new_dlg function is used to create a window, the wm_create event does not work HOT 6
- Async IO should be marked as "unsafe" HOT 1
- CreateToolhelp32Snapshot error when compiling for x86
- Panic in wstring/ QueryFullProcessImageName HOT 3
- How to set up a transparent window? HOT 1
- please font settings HOT 7
- Add missing API to open app in foreground? HOT 3
- [Question] How can I set the pszText into NMLVDISPINFO correctly when handling lvn_get_disp_info event? HOT 19
- [Question] Using MutFn as WinApi callback
- WString pointers cause issues on stack for certain API calls HOT 5
- Build fails for the i686-pc-windows-(msvc/gnu) targets HOT 8
- winsvc.h HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winsafe.