Bastiaan Veelo wrote:
Emil Jerabek wrote:
If all you need is to pass argc and argv to the library, there are
predefined variables CParamCount and CParameters (of type integer and PCString, respectively, which matches C int and **char).
Yes it is! But I get undeclared identifier errors when using these. Do I need to pull some switches for it to work?
In C you have to use the linker name, as revealed in gpc.pas:
CParamCount: Integer; attribute (name = '_p_CParamCount'); external; CParameters: PCStrings; attribute (name = '_p_CParameters'); external;
i.e.:
int _p_CParamCount; const char **_p_CParameters;
Frank