Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: open watcom and stata plugin


From   James Hassell <[email protected]>
To   [email protected]
Subject   Re: st: open watcom and stata plugin
Date   Mon, 26 Jan 2004 11:42:42 -0600

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:




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index