> tried it, but it did not fix the problem.
Yes, it was only a guess. What is special in your code is, that you are working with value types, while most C libs I am aware of are using pointers. If the C lib really want to use value types, it may still be a problem how Nim compiler pass value types to the C library. Sorry, can not help. Maybe you should mention which OS and which C compiler you are using, that may make it easier for the experts...