Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
kareem15
Contributor III
Contributor III

Unable to add UDF to qlik

Hi team , 

I had complied a UDF and generated dll and .so file . when I followed the steps from Document , i couldn’t  see my UDF in qlik under expression builder>>functions>>UDF .

need some help on this . please let me know if additional details needed 

followed this . 
https://help.qlik.com/en-US/replicate/November2023/Content/Global_Common/Content/SharedEMReplicate/C...

Labels (2)
14 Replies
DesmondWOO
Support
Support

Hi @kareem15 ,

Thank you for reaching out to Qlik Community.

We have a sample program, MyTransformation.sln, located in the addon folder. Please build it and you will get a dll file. If successful, you should find "prefix_with(X, Y) under "User defined".

If problem persists, please attach your addons_def.json.

Regards,
Desmond

 

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
kareem15
Contributor III
Contributor III
Author

Thank you for the suggestion , let me try that 

kareem15
Contributor III
Contributor III
Author

Do we need to Build the code at the place where Qlik is installed?
in my case Qlik is installed in VDI (remote) 
can I build the code in my local and move the Dll file to specific folder and find UDF in qlik ?

john_wang
Support
Support

Hello @kareem15 ,

The UDTF can be compiled on any Windows machine. However, due to module dependencies, ensure the module is built in Release (not Debug) mode. Once the compilation is complete, copy and distribute the resulting DLLs to the appropriate Replicate machines.

The similar discussion can be found at Qlik replicate sample Functions not showing up in UI.

Hope this helps.

John.

 

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
kareem15
Contributor III
Contributor III
Author

thank you for Response . 
I am using MAC and i generated dll using below command :

gcc -shared -O2 -o MyTransformation.dll MyTransformation.c \
-I/opt/homebrew/opt/openssl@3/include \
-L/opt/homebrew/opt/openssl@3/lib -lssl -lcrypto

and copied the dll to - D:\Program Files\Attunity\Replicate\addons\samples\MyTransformation 
and restarted the qlik service , still I could not see UDF in qlik 
sharing screenshots and addons_def.json below 

addons_def.json:

 

{
  "addons":  
  [
    {
      "name":  "MyPasswordProvider",
      "type": "STARTUP",
      //"lib_path": "samples\\MyPasswordProvider\\MyPasswordProvider.dll",
      //"lib_path": "samples/MyPasswordProvider/MyPasswordProvider.so",
      "init_function":  "ar_addon_init"  
    },
    {
      "name": "MyTransformation",
      "type": "STARTUP",
      "lib_path": "samples\\MyTransformation\\MyTransformation.dll",
      //"lib_path": "samples/MyTransformation/MyTransformation.so",
      "init_function": "ar_addon_init"
    },
{
      "name": qlik_encryption
      "type": "STARTUP",
      "lib_path": "samples\\MyTransformation\\qlik_encryption.dll",
      //"lib_path": "samples/MyTransformation/qlik_encryption.so",
      "init_function": "ar_addon_init"
    }
  ]
}

 

kareem15_0-1733512416862.png

 

kareem15_1-1733512431343.png

 

 

kareem15
Contributor III
Contributor III
Author

As I am mac user , do i need to generate .so file and use that instead of DLL ?

Heinvandenheuvel
Specialist III
Specialist III

"As I am mac user , "

Personally I would never ever use a MAC to build a Windows target executable, but that's me. KISS.

Google response to "mac gcc for windows execution" ===>>  "To use a Mac's GCC compiler to compile code that will run on Windows, you need to perform a "cross-compilation" by installing a Windows-targeting toolchain on your Mac, typically using a package like MinGW (Minimalist GNU for Windows) or Cygwin which provides a Windows-compatible environment on your Mac, allowing you to compile code that will run on a Windows system...  Followed by detailed instructions on using -m64 and pointing to Windows libraries.

Unfortunately our post does not give any indication whether something like that is being used.

hth,

Hein.

kareem15
Contributor III
Contributor III
Author

I switched to windows and build in release mode . 
below are the screenshots based on steps for mentioned above :

kareem15_1-1733851538302.png


dll got generated in below folder and we moved it to sample\mytransformation 

kareem15_2-1733851610178.png

kareem15_3-1733851688989.png

My repcmd log file :

kareem15_4-1733851796690.png

 

 

kareem15
Contributor III
Contributor III
Author

Still cannot see the UDF , any further help will be appreciated 

kareem15_5-1733851852276.png