mstorsjo / msvc-wine

Scripts for setting up and running MSVC in Wine on Linux
Other
682 stars 83 forks source link

link doesn't work with rsp #127

Closed devoln closed 7 months ago

devoln commented 7 months ago

I installed msvc-wine yesterday on Ubuntu 22.04 in LXC container (Proxmox). Wine version is 6.0. Now I try to compile a simple C++ program with cmake using msvc-wine and it won't configure because of some linking error during compiler detection. I tried to debug the problem and could narrow down it to the linker. For some strange reason, it doesn't work with .rsp files that cmake generates. It just replaces all the characters in it with ?, even though they are ASCII! If I just replace @file.rsp with its content (main1.obj), it works correctly. What the hell is going on? I tried to search this issue on the internet but couldn't find anything like this.

devoln@ubuntu-code:~/test$ cat file.rsp 
main1.obj
devoln@ubuntu-code:~/test$ /opt/msvc/bin/x86/link.exe @file.rsp
Microsoft (R) Incremental Linker Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.

????? 
LINK : fatal error LNK1181: cannot open input file '?????.obj'
devoln@ubuntu-code:~/test$ wine /opt/msvc/vc/tools/msvc/14.39.33519/bin/Hostx64/x64/link.exe @file.rsp
0054:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1".
Microsoft (R) Incremental Linker Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.

慭湩⸱扯੪
LINK : fatal error LNK1181: cannot open input file '慭湩⸱扯੪.obj'

devoln@ubuntu-code:~/test$ wine /opt/msvc/vc/tools/msvc/14.39.33519/bin/Hostx64/x64/link.exe main1.obj
0050:err:explorer:initialize_display_settings Failed to query current display settings for L"\\\\.\\DISPLAY1".
Microsoft (R) Incremental Linker Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.

devoln@ubuntu-code:~/test$

I compared the checksum of the file /opt/msvc/vc/tools/msvc/14.39.33519/bin/Hostx64/x64/link.exe and C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\Hostx64\x64\link.exe on my Windows computer. They matched, but on Windows it works fine.

mstorsjo commented 7 months ago

This sounds like a potential Wine bug, can you recheck with a recent version?

devoln commented 7 months ago

This sounds like a potential Wine bug, can you recheck with a recent version?

I found a fork of this repository with a commit which message was something about replacing wine-development with wine on Ubuntu. I decided to try to install wine instead of wine-development and the problem solved!

Surprisingly, the stable wine (6.0.3) is newer than wine-development (6.0.0).

mstorsjo commented 7 months ago

Oh, interesting. To be clear - I presume this is about the Dockerfile? I think I've made the choice to go with wine-development a couple distribution bumps ago, when the situation probably was the other one, but we certainly could switch this to use plain wine instead.

devoln commented 7 months ago

This commit: https://github.com/huangqinjin/msvc-wine/commit/1706b03809e9b98fc94445a641d6921ccc250aff I don't use docker. Initially, I had installed wine-development manually because it was used in ReadMe.md.

mstorsjo commented 7 months ago

Ah, I see. (FWIW, that commit exists in this repo as well.)

I created https://github.com/mstorsjo/msvc-wine/pull/128 to simplify this, I'll merge it once the CI is done running.

mstorsjo commented 7 months ago

Ah, I see. (FWIW, that commit exists in this repo as well.)

I created #128 to simplify this, I'll merge it once the CI is done running.

I merged this now, so now the recommendation should be to just install wine64 - I presume that resolves this issue?