Skip to content

Error in verbose mode when argv[0] is not an actual path #1064

@blattersturm

Description

@blattersturm

If running plain cppwinrt -v from a console with the Windows SDK in PATH I get the following error:

cppwinrt : error canonical: The system cannot find the file specified.: "cppwinrt.exe"

It seems the following line expects argv[0] to be an actual path to cppwinrt.exe without the .exe specified, which is not necessarily the case (e.g. when running from PATH, but also for example on non-Windows platforms with symlinks or certain kinds of exec being used):

cppwinrt/cppwinrt/main.cpp

Lines 269 to 271 in e192094

if (settings.verbose)
{
w.write(" tool: %\n", canonical(path(argv[0]).replace_extension("exe")).string());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions