Quote:>I was trying to compile the aptlib file using C++ compiler. It was giving the following errors. I tried using extern "C", but it doesnot seem to work.
>***********************************************************************************
>"a.cc", line 24: warning: old style definition of main() (anachronism)
>"a.cc", line 38: error: undefined function fsinit called
>"a.cc", line 45: error: unexpected 1 argument for fsopenscreen()
>"a.cc", line 47: error: unexpected 1 argument for fsdblogin()
>"a.cc", line 52: error: unexpected 1 argument for fsdbrec()
>"a.cc", line 53: error: unexpected 1 argument for fsdbenviron()
>"a.cc", line 68: error: unexpected 1 argument for fsgetform()
>"a.cc", line 71: error: unexpected 1 argument for dbclose()
>"a.cc", line 72: error: unexpected 1 argument for fsabort()
>"a.cc", line 76: error: unexpected 1 argument for fsinstallproc()
>"a.cc", line 78: error: unexpected 1 argument for fsprocargs()
>"a.cc", line 82: error: unexpected 1 argument for fscallform()
>"a.cc", line 84: error: unexpected 1 argument for dbclose()
>"a.cc", line 86: error: undefined function fsexit called
>"a.cc", line 96: error: argument declaration syntax
>***************************************************************************
Yes -- I had these problems too and they were really irritating. Don't tell my
Unix and Sybase technical support but I altered the "sybfrs.h" in my
/usr/local/sybase directory (we use Unix).
This header file declares its dblib procedures, like the ones you've called
above, like:
extern RETCODE fscallform();
I think you can get away with this type of loose C procedure declarations in C
but not with C++. You need that procedure declaration to look like:
extern RETCODE fscallform( FORM * );
so that your C++ knows that a variable of type FORM * is going to be passed.
Here are some more of the proc declarations you'll need:
Quote:> for fsopenscreen(int *, char *[], char *)
> for fsdbrec(LOGINREC *)
> for fsdbenviron(DBPROCESS *)
> for fsgetform(char *, char *)
> for fsabort(char *)
> for fsinstallproc(FSPROCEDURE [])
> for fsprocargs(char *, POINTER * )
> for fscallform(FORM *)
I know this list isn't complete for your needs. I just found what was supposed to
be in these declarations from the
"Sybase APT-Library/C Reference Manual"
so you can look up the rest. Good Luck!
=========================================================================
Fannie Mae Phone : (202) 752-4576
4000 Wisconsin Ave NW
Washington, DC 20016
Note: the opinions above are my own and don't necessarily reflect those
of my employer.
=========================================================================