-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
link.exe crashes everytime in cmake #21
Comments
Cmake often tries to enable pdb options which don't work well in wine; I usually use a custom patched cmake when building with msvc in wine. See https://gitlab.kitware.com/mstorsjo/cmake/-/commits/msvc/ for one version of such patches (haven't verified atm that it works with the current version of msvc-wine though). |
Confirmed it worked for me with CMake 3.19.4 built from source with 3 @mstorsjo patches on top of it |
@mstorsjo @dmikushin
cmake project :cxx_hello cmake toolchain.cmake: cmake_minimum_required(VERSION 3.8.0) message(STATUS "ARCH:${ARCH}") if(NOT DEFINED ARCH) list(FIND _supported_archs ${ARCH} contains_ARCH) if(DEFINED MSVC_WINE_BIN_PATH) set(ENV{PATH} "${MSVC_WINE_BIN_PATH}/${ARCH}/:$ENV{PATH}") message(STATUS "PATH: ${MSVC_WINE_BIN_PATH}") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) run :
CMake error log: -- ARCH:x86 CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. -- Configuring incomplete, errors occurred! The ARCH and CXX compilers were detected successfully at first, and the message (STATUS "PATH: ${MSVC_WINE_BIN_PATH}") has been printed, it seems that this toolchain.cmake has been run many times. thanks! |
@zuowanbushiwo To use CMake with MSVC, you can't use the default "Unix Makefiles" generator. Your best bet is to use Ninja. (The other ones that work with MSVC on Windows are the Visual Studio project generator, and nmake. Using the visual studio project files via Wine probably is more tricky, the nmake generator might work but I haven't tested it. Edit: Those generators aren't available in a unix-based cmake; the only choice available that works with MSVC is ninja.) I pushed a branch here which contains a working example of building things with CMake: https://github.com/mstorsjo/msvc-wine/commits/cmake |
@mstorsjo
cmake out :
if change to this:
cmake error output:
it seems that this toolchain.cmake has been run many times? and didn't define the ARCH variable in the next few times? Thanks! |
Hmm, maybe, I'm not sure if this is a combination of cornercases in wine that aren't implemented, or your cmake build doing something more fancy than I've tested. I don't get those errors with my example.
Sorry, I don't have time to help you figure out your own cmake toolchain files - things work with the example I provided, anything outside of that is up to you to figure out. |
Thanks!you are so great。 |
I created the docker image using your tool the other day, and am running into an issue where I can not get link.exe to run in wine without crashing.
It always comes up with a "Unhandled exception: page fault on write access" when ever cmake calls it. calling link byitself will print the syntax and not cause an error, but as soon as it tries to do something it crashes.
I also tried using the 32bit version of link and had the same problem.
The versions it downloaded were
MSVCVER=14.27.29110
SDKVER=10.0.18362.0
Do you have an ideas what could be happening and what I could do to fix it?
Thanks.
The text was updated successfully, but these errors were encountered: