Karamba C# error [karambaPINVOKE] when running in Grasshopper

Hi,

I have a question regard the use of KarambaCommon outside and inside Grasshopper; I created a C# library (SEngineer) in visual studio to run Karamba outside Grasshopper. I have tested this library in visual code and this didn’t give any errors. However, when a GHA of the SEngineer project is created/build, a feb.karambaPINVOKE error is observed in the methods were Karamba is used. This error does not occur when I install Karamba via the packagemanager. Is it possible to run the Karamba script in Grasshopper without installing Karamba via the packagemanager in Rhino? See images for clarification.



Thanks,
Max

Hi @maxhamelynck,
the problem might be related to a bug in an older installer of version 2.2.0.17 where two dlls were missing, which are not by default present on all windows machines. Please try the latest installer from here: Releases · karamba3d/K3D_NightlyBuilds · GitHub.

If this does not work: Make sure that ‘karamba.dll’, ‘libiomp5md.dll’, ‘libifcoremd.dll’ and ‘libmmd.dll’ can be found by ‘karambaCommon.dll’: either place them in the same directory or in some other place where Windows10 looks by default.

An issue which sometimes occurs is that an outdated version of ‘libiomp5md.dll’ gets loaded before that which comes with Karamba3D. In that case replace older versions of ‘libiomp5md.dll’ on your harddisk with newer ones - but keep the old ones in case of problems.

– Clemens

1 Like

Hi Clemens,

I added KarambaCommon (V 2.2.0.142) through the NuGet package manager of visual studio, unfortunately the libiomp5md.dll’, ‘libifcoremd.dll’ and ‘libmmd.dll’ packages weren’t included after the build. So, I added them in the same directory, and it worked :smiley:

Thanks,
Max

Hi @maxhamelynck,
thanks for the hint! I will add the missing files in the NuGet Package asap.
– Clemens