Skip to content

Compile bug: error C2664: 'LSTATUS RegQueryValueExA(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD)': cannot convert argument 2 from 'const wchar_t [20]' to 'LPCSTR' #11802

@sheldonrobinson

Description

@sheldonrobinson

Git commit

$ git rev-parse HEAD
b9ab0a4

Operating systems

Windows

GGML backends

CPU

Problem description & steps to reproduce

I'm using library lcpp ^0.0.4.
$ git rev-parse HEAD
b9ab0a4

Compile error

ggml\src\ggml-cpu\ggml-cpu.cpp(293,21): error C2664: 'LSTATUS RegQueryValueExA(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD)': cannot convert argument 2 from 'const wchar_t [20]' to 'LPCSTR'

Fix:
RegQueryValueExA should be changed to RegQueryValueEx in lines 286 & 293.

RegQueryValueExA is char*, RegQueryValueExW is for wchar* and RegQueryValueEx will resolve to correct function based on setting -DUNICODE -D_UNICODE

First Bad Commit

No response

Compile command

flutter build windows --debug

Relevant log output

\windows\flutter\ephemeral\.plugin_symlinks\lcpp\src\llama_cpp\ggml\src\ggml-cpu\ggml-cpu.cpp(286,17): error C2664: 'LSTATUS RegQueryValueExA(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD)': cannot convert argument 2 from 'const wchar_t [20]' to 'LPCSTR' \build\windows\x64\plugins\lcpp\shared\ggml\src\ggml-cpu.vcxproj]
\windows\flutter\ephemeral\.plugin_symlinks\lcpp\src\llama_cpp\ggml\src\ggml-cpu\ggml-cpu.cpp(293,21): error C2664: 'LSTATUS RegQueryValueExA(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD)': cannot convert argument 2 from 'const wchar_t [20]' to 'LPCSTR' \build\windows\x64\plugins\lcpp\shared\ggml\src\ggml-cpu.vcxproj]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions