Shige asked the following:
>Have anyone used the open watcom compiler to create Stata plugin? I tried
>to compile the "hello" example, the compilation seemed ok, but when I
>tried to load it, I got "r(9998)", which is not documented in stata
>manual. Thanks for any comments.
A similar question was asked of Stata technical support several months back.
Here is what I found at that time:
----------
It appears that Watcom by default uses a different calling
convention when linking, opposed to gcc and MS Visual C++.
This is important because the Stata executable expects calling
conventions which are used by Visual C++ and gcc. It is my
understanding that by default, Watcom appends and underscore
(_) to function calls for name mangling. Borland's "command-
line-tools" compiler does something similar when it prepends
function calls with an underscore (_).
The solution for Watcom is to specify Pentium Pro stack calling
conventions. The option is (-6s).
Here is an example: