What are _Optlink and _System

Posted on 2006-03-27
Last Modified: 2010-08-05
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.

Question by:Daniel Van Der Werken
    LVL 19

    Author Comment

    by:Daniel Van Der Werken
    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?

    LVL 14

    Accepted Solution

    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

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now