Error: C2813: #import is not supported with /MP when compiling a Qt project.



  • Hi,
    I am trying to compile my project with #import directives such as

    @
    .....
    #import "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14\MSO.DLL"
    rename("RGB", "MSORGB")
    rename("DocumentProperties", "MSODocumentProperties")
    #import "C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB"
    .....

    @

    but bumping my head against the C2813: #import is not supported with /MP error.From http://msdn.microsoft.com/en-us/library/bb385193(v=vs.100).aspx I saw that the /MP flag only controls the number of processes the compiler uses to speed up the build process so I commented out the flag
    @

    QMAKE_CXXFLAGS += /MP

    @

    and thought the code would build as usual.It would just take longer .But the compiler them complains about syntax errors that are not there when the flag is not commented out.I know msdn proposes a workaround

    • Move all the #import directives in your various source files to one or more files, and then compile those files without the /MP option. The result is a set of generated header files.

    • In your remaining source files, insert #include directives that specify the generated headers, and then compile your remaining source files by using the /MP option. 
      

    and I am trying that tomorrow but don't understand how the non existent errors are introduced.I was wondering if there was a way to not use the /MP flag and have my code to compile.

    Thank you for your time.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.