Issue with lexactivator function's parameter passing


Currently, I’m working on cryptlex integration with Golang. When I’m trying to build the provided LexActivator sample from GitHub (, getting the following error:
“cannot use _Cfunc_CString(” < Included product data here > “) (type *_Ctype_char) as type *_Ctype_ushort in argument to _Cfunc_SetProductData”.

I have downloaded LexActivator for Windows 3.9.1 and copied “LexActivator.dll” and “LexActivator.lib” in the “libs” directory.

Installed Go version: 1.14

It looks like a typecasting issue while passing the parameter to the LexActivator function. How to resolve this issue?

Also, raised the same issue in GitHub. Please find the following issue link:



Which C/C++ compiler are you using on Windows?



Currently I’m using “TDM-GCC-64” compiler (


Also tried with “MinGW-w64” compiler, but getting same issue.


The issue is that on Windows, all the strings use wchar instead of char. C.Cstring() returns a char string. You need to pass a wchar string.

Did you try:


Hi Adnan,

Thank you for the prompt response.
Tried using “FromGoString” function to convert to “wchar” as suggested (, still getting the following error.
“cannot use < Included product data here > (type wchar.WcharString) as type *_Ctype_ushort in argument to _Cfunc_SetProductData”

It looks like the SetProductData function expects *_Ctype_ushort as the parameter. Please let us know how to get past the issue.


We are looking into this issue. Will keep you posted.


Thank you for the update


We have written a new go package for lexactivator which works on all the platforms, and abstracts all the C interfacing. We will be releasing it in a day or two.



We have released a new package, please refer to the following:



Thank you for the fix. We will get back to you if we are facing any further issues.