Skip to content

PyCommandlet.cpp compile error with wcsncpy #602

@slartibaartfast

Description

@slartibaartfast

While using UnrealEngine preview branch, I'm seeing the below error after adding the plugin to a project and compiling.
This is on a linux machine, ubuntu 18.04. The wchar.h file is part of the new toolchain.

[33/220] Compile PyCommandlet.cpp
[34/220] Compile PyPawn.cpp
[35/220] Compile PyUserWidget.cpp
/home/trota/Documents/UnrealProjects/test421a/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/PyCommandlet.cpp:94:3: error: no matching function for call to 'wcsncpy'
wcsncpy(argv[i], *PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);
^~~~~~~
/home/trota/Code/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v12_clang-6.0.1-centos7/x86_64-unknown-linux-gnu/usr/include/wchar.h:150:17: note: candidate function not viable: no known conversion from 'const TCHAR *' (aka 'const char16_t *') to 'const wchar_t *__restrict' for 2nd argument
extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
^
1 warning generated.

I tried changing line 94 of PyCommandlet.cpp in various ways, but either received a similar error or caused python to crash. None of these worked...


    //wcsncpy(argv[i], UTF8_TO_TCHAR(*PyArgv[i].ReplaceEscapedCharWithChar()), PyArgv[i].Len() + 1);

    //wcsncpy(argv[i], TCHAR_TO_UTF8(*PyArgv[i].ReplaceEscapedCharWithChar()), PyArgv[i].Len() + 1);

    //wcsncpy(argv[i], (const wchar_t *)*PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);


    //wcsncpy(argv[i], (wchar_t *)*PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);

    //wcsncpy(argv[i], (wchar_t*)*PyArgv[i].ReplaceEscapedCharWithChar(), PyArgv[i].Len() + 1);

Do I need to add a definition for wcsncpy? Or something else? Thanks in advance!

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