-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
undefined symbol: MapViewOfFile2 #22040
Comments
it seems it is not part of Mingw64 https://github.com/msys2-contrib/mingw-w64/blob/master/mingw-w64-headers/include/memoryapi.h |
@nektro I think you are referring to the following
and thats limited to windows10.0.15063 check out here : https://github.com/marlersoft/zigwin32/blob/32d085ee67374ad2ec24fc012e6876ca27958fb7/win32/system/memory.zig#L1098 |
As a workaround, does NtMapViewOfSection suit your use case? zig/lib/std/os/windows/ntdll.zig Line 144 in e163ae7
|
@mesidex NtMapViewofSection is different than MapViewFile2, however i managed to make it work with following extern API inline call. https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-mapviewoffilenuma2 pub extern "api-ms-win-core-memory-l1-1-5" fn MapViewOfFileNuma2(
FileMappingHandle: HANDLE,
ProcessHandle: HANDLE,
Offset: u64, // ULONG64
BaseAddress: ?*anyopaque, // PVOID (optional)
ViewSize: usize, // SIZE_T
AllocationType: u32, // ULONG
PageProtection: u32, // ULONG
) callconv(windows.WINAPI) ?*anyopaque; // Returns PVOID |
I have it:
|
Zig Version
0.13.0
Steps to Reproduce and Observed Output
it seems MapViewOfFile2 is not declared or linked into Zig code base yet, currently i am declaring it externally :
raising the following linking error :
any alternative solution? if we imported the C headeand then call it from it's name space should be a temporary solution?
Expected Output
error: warning(link): unexpected LLD stderr:
lld-link: warning: undefined symbol: MapViewOfFile2
The text was updated successfully, but these errors were encountered: