I’m currently working on a project which led me to re-implement a specific DLL using Wine. To be able to compile the C code with the coresponding .spec file into a 32-bit and 64-bit shared object capable of being loaded from Wine processes, I have installed the following packages on my Tumbleweed machine:
wine
wine-32bit
wine-devel
wine-devel-32bit
However, so far I have only been able to compile my project as a 32-bit shared object using
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -ladvapi32: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -luser32: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -lwinecrt0: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -lkernel32: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cannot find -lntdll: No such file or directory
collect2: error: ld returned 1 exit status
winegcc: /usr/bin/gcc failed
(I have found specifying -L/usr/lib64/wine/i386-unix in the 32-bit variant to be mandatory because even winegcc did not pick up Wine’s library path.)
I suspect this is because /usr/lib64/wine/x86_64-unix is missing all of the above archive files (e.g. libkernel32.a), but /usr/lib/wine/i386-unix has these archive files.
No matter what packages I install, I cannot get compiling 64-bit “DLLs” to work (wine-wow64-devel is missing even the 32-bit archive files).
I feel like I should be able to compile my project as a 64-bit binary (I’m on a 64-bit machine). Is this assumption wrong, am I doing something wrong or are the packages missing some files?
I’d be grateful for any advice as I’ve been stuck in this situation for quite a while now.
I am not familiar with Wine, but quickly looking at the wine-devel, the libraries are listed under /usr/lib64/wine/x86_64-windows. Which sounds sort of logical.
The problem with these versions is that they’re PE binaries. I also haven’t been able to compile my project as a PE binary using MinGW and can’t use the x86_64-windows variants because GCC fails with:
/usr/bin/ld: relocatable linking with relocations from format pe-x86-64 (/usr/lib64/wine/x86_64-windows/libwinecrt0.a(debug.o)) to format elf64-x86-64 (tmp66fd686a/myproject64-00000001.spec-00000001.o) is not supported
winebuild: /usr/bin/ld failed with status 1
winegcc: /usr/bin/winebuild failed
Sorry, don’t mean to hijack this thread, but I have a few of simple questions.
What’s the difference between those wine packages with “32bit” as part of their names and those without it?
Am I to assume that those without “32bit” are actually 64bit?
What packages do I need to install to get a working wine in my system?
This is what zypper found:
S | Name | Summary | Type
---+----------------------------+---------------------------------------------------+--------
| python3-twine | Collection of utilities for interacting with PyPI | package
| python311-twine | Collection of utilities for interacting with PyPI | package
| q4wine | Qt GUI for WINE | package
| q4wine-lang | Translations for package q4wine | package
| wine | An MS Windows Emulator | package
| wine-32bit | An MS Windows Emulator | package
| wine-binfmt | The binfmt_misc support for Windows | package
| wine-binfmt-standalone | Standalone binfmt_misc support for Windows | package
| wine-devel | Files for Wine development | package
| wine-devel-32bit | Files for Wine development | package
| wine-gecko | The Wine specific Gecko HTML rendering engine | package
| wine-mono | A .NET replacement for use by Wine | package
| wine-nine-standalone | Wine Gallium Nine Standalone version | package
| wine-nine-standalone-32bit | Wine Gallium Nine Standalone version | package
| wine-staging | An MS Windows Emulator | package
| wine-staging-32bit | An MS Windows Emulator | package
| wine-staging-devel | Files for Wine development | package
| wine-staging-devel-32bit | Files for Wine development | package
| winetricks | A way to work around problems in WINE | package
OpenSUSE is 64-bit only, actually. So when installing packages you generally only need to install the packages without any *bit suffix. To get Wine, a simple zypper install wine should be enough, though you might want to also include wine-mono if it’s not being installed automatically.
Now, I need to obtain the app the requester is interested in running on Linux; the app is graphical and already built in Windows, presumably using WPF or .NET.
You mentioned installing mono, but about .NET itself?
I see. OK, again with zero wine knowledge - but looking at the spec file and build log I do not see anything either populating x86_64-unix or removing anything from this location. Upstream may be a better place to ask, as it does not look like a packaging issue. May be some build flag is missing, in which case you can certainly come back and open bug report.
I’ve asked about this upstream on Wine’s forums and Wine’s developer’s mailing list. Compiling Wine from source as suggested fixed the problem for now.
Specifying -L also shouldn’t be necessary, according to Wine devs.