Hi, I have studied compiling functions from language C to Mathematica as LibraryLink. Do you know how can I connect function with variable count of inputs? I used precompiled example:
DLLEXPORT int demoNoArguments(WolframLibraryData libData, mint Argc, MArgument *Args, MArgument Res)
{
mint b = Argc;
MArgument_setInteger(Res, b);
return LIBRARY_NO_ERROR;
}
From this code is clear that number of arguments is defined somewhere outside.
I would like prepare override function (multiple definitions of symbol) like this:
demo1=LibraryFunctionLoad["demo", "demoNoArguments", {Integer}, Integer];
demo1=LibraryFunctionLoad["demo", "demoNoArguments", {Integer, Integer}, Integer];
or better:
demo1=LibraryFunctionLoad["demo", "demoNoArguments", {_Integer..}, Integer];
but if I try to define function again, I see message:
"LibraryFunction::overload: The function demoNoArguments has already been loaded with argument types {Integer,Integer}. The new function will be an overload for different types. >>"
second choice is not possible to use because I see error:
LibraryFunction::btype: "Invalid type and/or rank specification in _Integer... "
Does anyone have any advice?