as suggested by @tonfilm in the chat I, or let’s say chatgpt, created a .net wrapper for a native lib i want to call. I(!) have set the dll name to the one I’m using, without any path. Here’s the wrapper:
namespace TetGenNativeWrapper
{
using System;
using System.Runtime.InteropServices;
// Define a class that wraps the native DLL functions
public class NativeDllWrapper
{
// Declare the native functions as static extern methods with [DllImport] attribute
// Use the appropriate calling convention, parameter types, and marshaling options
[DllImport("TetGen2vvvv.dll")]
public static extern int tetCalculate(String behaviour, double[] vertXYZ, double[] vertAttr, int[] vertMarker, int[] numPoly, int[] numVertices, int[] vertIndex, int[] numFHoles, double[] fHoleXYZ, int[] facetMarker, double[] HoleXYZ, double[] RegionXYZ, double[] RegionAttrib, double[] RegionVolConst, int[] binSizes, String fileName);
}
// Define a class that exposes the native DLL functions to other .NET assemblies
// You can use the same name and signature as the native functions, or provide a more idiomatic .NET API
public class NativeDllAdapter
{
// You can use the same name and signature as the native functions
// Just call the wrapper methods internally
public static int NativeFunction1(String behaviour, double[] vertXYZ, double[] vertAttr, int[] vertMarker, int[] numPoly, int[] numVertices, int[] vertIndex, int[] numFHoles, double[] fHoleXYZ, int[] facetMarker, double[] HoleXYZ, double[] RegionXYZ, double[] RegionAttrib, double[] RegionVolConst, int[] binSizes, String fileName)
{
return NativeDllWrapper.tetCalculate(behaviour, vertXYZ, vertAttr, vertMarker, numPoly, numVertices, vertIndex, numFHoles, fHoleXYZ, facetMarker, HoleXYZ, RegionXYZ,RegionAttrib,RegionVolConst,binSizes, fileName);
}
}
}
my file structure looks like this:
VL.TetGen.vl
/runtimes/win-64/native/TetGen2vvvv.dll
/lib/Net 6.0/TetGenNativeWrapper.dll
and here’s the error I get after referencing TetGenNativeWrapper.dll and calling the function:
TetGen2vvvv.dll doesn’t have any further dependencies…
help :|