Cannot convert 'char**' to 'wchar_t**' for argument '2' to void PySys_SetArgv(int, wchar_t**)'

1,059 views
Skip to first unread message

辛文飞

unread,
May 3, 2017, 4:52:19 AM5/3/17
to ns-3-users
When I try to compile ns-3.26 in Manjaro, it has raised me this error. I have installed related dependency.

I have solved this problem after I modify the source code of visual-simulator-impl.cc in line 118 in the folder src/visualizer/model.

I change the cast prefix "(char **)" to "(wchar_t **), then it passed.


Tommaso Pecorella

unread,
May 3, 2017, 7:00:19 PM5/3/17
to ns-3-users
Hi,

thanks for reporting, I'll open a bug.

T.

Yunus Özen

unread,
Jan 5, 2019, 3:11:20 AM1/5/19
to ns-3-users
Hi,
Still have the same problem even with ns-3.29 on manjaro-xfce-18.0.2 with python 3.7

4 Mayıs 2017 Perşembe 02:00:19 UTC+3 tarihinde Tommaso Pecorella yazdı:

gabriel...@gmail.com

unread,
Jan 5, 2019, 11:22:19 AM1/5/19
to ns-3-users
Had this problem while working on CMake. Was caused by the default python being python3 instead of python2.

//For Python2
const char *argv[] = {"python2", NULL};    
Py_Initialize ();    
PySys_SetArgv (1, (char **)argv);

//For Python3
const wchar_t *argv[] = {L"python3", NULL};
Py_Initialize ();    
PySys_SetArgv (1, (wchar_t **)argv);      
Reply all
Reply to author
Forward
0 new messages