• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

What are _Optlink and _System

Okay.  I hate to admit it, but I'm a one-platform kind of guy.  Most of my programming has been on Windows.

I'm trying to build some code that seems cross-platform.  AIX, OS/2, Windows.

I even went from Visual Studio 2005 back to Visual Studio 6.0 just to make working with this code easier.  Seems Microsoft made a lot of core changes to the basics in this last release.

Anyway, I'm getting the following error:

error C2146: syntax error : missing ';' before identifier 'AhiInsItemImage'

So, I define __WINDOWS__ in my project settings and that seems okay.  However, I can't figure out exactly why I'm getting this error.  

#if defined(__OS2__)
   #define AHIITPTY_API _System  
#elif defined(__WINDOWS__)
   #define AHIITPTY_API _System
   #define AHIITPTY_API

unsigned long AHIITPTY_API AhiInsItemImage(                          
                        unsigned short count,
                        AHIITIMG       ReqList[] );

Obviously, AHITPTY_API isn't defined properly.  I Googled (it's a verb now, I think) _System but there's a lot of chaff there to go through.  Heck, why do I have all of these expert points myself if I can't ask a question now and then?

Anyone able to help me out here?  I know we're defining an API call, but I'm not sure what the basis is, etc.

Daniel Van Der Werken
Daniel Van Der Werken
1 Solution
Daniel Van Der WerkenIndependent ConsultantAuthor Commented:
Just a note:

I replaced _System with __stdcall and it compiles, but I'm not sure that's the best calling convention to us.  Should I use __cdecl instead?  One cleans up the stack by itself and one doesn't.  I'm thinking perhaps __cdecl is a better choice for cross-platform code.  Any ideas?

Because you cannot share binaries between different platforms, it does not matter which calling convention you use. For each platform you have to recompile. The only thing you need to take care about is compiling all code on a platform with the same settings. Otherwise you will get either linker errors, or your program will simply crash.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now