Jerry (lanceboyle) wrote:
I have not been able to solve the problem when calling _p_initialize from Ada. I still get the Ada compiler telling me, "too many arguments in call." I suspect that I might be passing the wrong _kinds_ of arguments but not the wrong number.
I was able to successfully call Pascal from Ada using yours files, with the following modifications:
1) declared that _p_initialize take parameters:
type pchar is access character; type ppchar is access pchar;
....
procedure p_initialize (argc : integer; argv, envp : ppchar; options : integer); pragma Import(Convention => C, Entity => p_initialize, External_Name => "_p_initialize");
2) changed the call to use C pointers (I do not know how to convert Ada access to C pointer):
p_initialize (Argument_Count_Plus_1, --C_Command_Name_String'access, null, null, 0); -- Line 29
3) Added -lm to the linker command line