Menu

About Import directive

deostroll
2008-04-12
2012-09-26
  • deostroll

    deostroll - 2008-04-12

    Is the import directive a c++ standard or a microsoft invention?

    I am trying to import an olb file it gives me all sorts of errors.

    I want to know the general syntax of an import statement.

     
    • cpns

      cpns - 2008-04-12

      It is not part of the C++ language. Where have you seen this used?

      Did you mean "import" or rather "#import". The first is part of the Microsoft Interface Definition Language (MIDL), the second is a non-standard pre-processor directive. In GCC the directive performs an entirely different function than it does in MSVC++ and they are unrelated:

      GNU #import: http://gcc.gnu.org/onlinedocs/cpp/Obsolete-once_002donly-headers.html#index-g_t_0023import-116
      MSVC++ #import: http://msdn2.microsoft.com/en-us/library/8etzzkb6(VS.71).aspx

      "import" is not listed as a keyword for either MSVC++ or GCC. http://msdn2.microsoft.com/en-us/library/2e6a4at9(VS.71).aspx

      If you have seen it in C++ code, it may have been declared as a macro somewhere.

      If you meant #import, then if it will work at all you need to use Microsoft's tools. MSVC++ 2008 Express Edition is free.

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.