KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q45946: Unresolved Externals Using OS/2 Functions and INCL_NOCOMMON

Article: Q45946
Product(s): See article
Version(s): 5.10
Operating System(s): OS/2
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 25-JUL-1989

If you are using OS/2 functions and getting "unresolved external"
messages at link time even though OS2.H is included, check for a
definition of the manifest constant INCL_NOCOMMON. The definition of
this constant excludes any function group that is not explicitly
included by the definition of another manifest constant.

For example, to include the OS/2 system functions (DOS) and exclude
all others, the following two statements must exist in the source
code:

   #define INCL_NOCOMMON
   #define INCL_DOS

Look closely at the "unresolved external" message. If the compiler has
prepended an underscore to the function name, then the prototype is
not being included. All OS/2 functions are defined with a PASCAL
calling sequence. Therefore, there should never be an underscore
prepended to the function name.

As a quick test, remove the INCL_NOCOMMON statement from the code and
recompile. If the program compiles and links without the INCL_NOCOMMON
statement, then you have only to determine which manifest constant
correctly includes the function group that includes the function in
question.

As an alternative, compiling at warning level three generates a "no
prototype given" warning for the function if the function prototype is
being excluded by the INCL_NOCOMMON statement. If this is the case,
determine which manifest constant will include the function prototype,
and define it along with the INCL_NOCOMMON statement.

A comprehensive listing of these manifest constants can be found in
the "Microsoft OS/2 Programmer's Reference," Volume #1, Pages 41-44.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.