Skip to main content
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Machholz
Contributor II
Contributor II

Unable to Create a User Defined Function in Replicate

Hello all, 

I have followed the documentation, read the README in the /addons folder, and compiled the sample UDF 'My Transformation' successfully. But the Qlik service is unable to load, and I am thinking it is because there is an error either in the addons_def.json file or something within the .dll. I am unable to figure it out and would appreciate any help.

Here is my addons_def.json:

Machholz_0-1718636155824.png

 

I have already tried using an absolute path as well, but that did not work. Any help is appreciated.

Thanks 

Qlik Replicate

Labels (1)
12 Replies
Machholz
Contributor II
Contributor II
Author

Hello @john_wang,

I also received that same error in "repcmd.log" but wasn't sure what that was. I used a cli compiler instead of Visual Studio directly, so I will try your instructions and see if the problem continues. 

Thanks.

john_wang
Support
Support

Hello @Machholz ,

thanks for the update.

Regards,

John.

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

Hi John,

I wanted to check in to see if there have been any updates on this issue. I'm encountering the same error:

00016704: 2024-11-03T20:49:16 [ADDONS ]W: Failed to load add-on path <C:\Program Files\Attunity\Replicate\addons\MyTransformation\MyTransformation.dll>, error: <%1 is not a valid Win32 application. > (at_addons_manager.c:251)

I’ve tried compiling the DLL as a 64-bit application using Visual Studio Developer Command Prompt, but I’m still running into the same problem. Do you have any solutions or suggestions?

The compile code I used was this:

 

cl /LD /O2 /MACHINE:x64 MyTransformation.c /Fe:MyTransformation.dll /I "C:\Program Files\Attunity\Replicate\addons\include"

 




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": "MyTransformation\\MyTransformation.dll",
			//"lib_path": "samples/MyTransformation/MyTransformation.so",
			"init_function": "ar_addon_init"
		}
	]
}

 



Thanks for your help!