Menu

#2766 windows: wd2d.cpp could not be compiled without UNICODE

None
pending-fixed
Windows (118)
2025-06-29
2025-02-02
Anonymous
No

Gnuplot 6.1 3c2133c built without UNICODE, i.e. UNICODE and _UNICODE are not defined.
Platform: MinGW

Expected behavior: wd2d.cpp can be compiled and Print... in the windows terminal should work like a UNICODE build.

Observed behavior:

src/win/wd2d.cpp:995:8: error: no matching function for call to 'PTOpenProvider'
  hr = PTOpenProvider(printerName, 1, &provider);
       ^
note: candidate function not viable: no known conversion from 'PCTSTR' (aka 'const char *') to 'PCWSTR' (aka 'const wchar_t *') for 1st argument
HRESULT WINAPI PTOpenProvider(PCWSTR pszPrinterName, DWORD dwVersion, HPTPROVIDER *phProvider);
               ^~~~~~~~~~~~~~~~~~~~~~~
src/win/wd2d.cpp:1031:5: error: cannot initialize a parameter of type 'LPCWSTR' (aka 'const wchar_t *') with an lvalue of type 'LPCTSTR' (aka 'const char *')
    szDevice, lpgw->Title,
    ^

Discussion

  • Ethan Merritt

    Ethan Merritt - 2025-02-02
    • summary: wd2d.cpp could not be compiled without UNICODE --> windows: wd2d.cpp could not be compiled without UNICODE
    • Group: -->
    • Priority: -->
     
  • Bastian Märkisch

    • labels: --> Windows
    • status: open --> pending-fixed
    • assigned_to: Bastian Märkisch
     
  • Bastian Märkisch

    Fixed in the main branch.
    Why would a non-UNICODE build be still be interesting?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.