Results 1 to 7 of 7

Thread: Can't compile the Qutlook example

  1. #1
    Join Date
    Aug 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Can't compile the Qutlook example

    Hello,

    I use the Qt 4.3.1 commercial edition for Windows, and I want to test the ActiveQt example : "Qutlook".

    Unfortunately, during the compilation of this example, I get the following errors :

    Qt Code:
    1. mingw32-make all
    2. mingw32-make -f Makefile.Release all
    3. mingw32-make[1]: Entering directory `D:/workspace/Qutlook'
    4. g++ -c -O2 -Wall -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\4.3.1\include\QtCore" -I"c:\Qt\4.3.1\include\QtCore" -I"c:\Qt\4.3.1\include\QtGui" -I"c:\Qt\4.3.1\include\QtGui" -I"c:\Qt\4.3.1\include" -I"c:\Qt\4.3.1\include\ActiveQt" -I"release" -I"." -I"c:\Qt\4.3.1\mkspecs\win32-g++" -o release\addressview.o addressview.cpp
    5. In file included from addressview.cpp:39:
    6. addressview.h:73:2: warning: no newline at end of file
    7. In file included from addressview.cpp:40:
    8. msoutl.h:30: error: use of enum `MsoFeatureInstall' without previous declaration
    9. msoutl.h:867: error: ISO C++ forbids declaration of `MsoFeatureInstall' with no type
    10. msoutl.h:867: error: invalid use of `::'
    11. msoutl.h:867: error: `MsoFeatureInstall' declared as an `inline' field
    12. msoutl.h:867: error: expected `;' before "FeatureInstall"
    13. msoutl.h:868: error: variable or field `SetFeatureInstall' declared void
    14. msoutl.h:868: error: `SetFeatureInstall' declared as an `inline' field
    15. msoutl.h:868: error: expected `;' before '(' token
    16. msoutl.h:17538: error: ISO C++ forbids declaration of `MsoFeatureInstall' with no type
    17. msoutl.h:17538: error: invalid use of `::'
    18. msoutl.h:17538: error: `MsoFeatureInstall' declared as an `inline' field
    19. msoutl.h:17538: error: expected `;' before "FeatureInstall"
    20. msoutl.h:17539: error: variable or field `SetFeatureInstall' declared void
    21. msoutl.h:17539: error: `SetFeatureInstall' declared as an `inline' field
    22. msoutl.h:17539: error: expected `;' before '(' token
    23. msoutl.h:24992: error: expected init-declarator before "_Application"
    24. msoutl.h:24992: error: expected `,' or `;' before "_Application"
    25. msoutl.h:24998: error: variable or field `SetFeatureInstall' declared void
    26. msoutl.h:24998: error: `Outlook::_Application::SetFeatureInstall' declared as an `inline' variable
    27. msoutl.h:24998: error: `int Outlook::_Application::SetFeatureInstall' is not a static member of `class Outlook::_Application'
    28. msoutl.h:24998: error: `MsoFeatureInstall' is not a member of `Office'
    29. msoutl.h:24998: error: expected `,' or `;' before '{' token
    30. msoutl.h:42174: error: expected init-declarator before "Application"
    31. msoutl.h:42174: error: expected `,' or `;' before "Application"
    32. msoutl.h:42180: error: variable or field `SetFeatureInstall' declared void
    33. msoutl.h:42180: error: `Outlook::Application::SetFeatureInstall' declared as an `inline' variable
    34. msoutl.h:42180: error: `int Outlook::Application::SetFeatureInstall' is not a static member of `class Outlook::Application'
    35. msoutl.h:42180: error: `MsoFeatureInstall' is not a member of `Office'
    36. msoutl.h:42180: error: expected `,' or `;' before '{' token
    37. addressview.cpp:274:2: warning: no newline at end of file
    38. mingw32-make[1]: *** [release\addressview.o] Error 1
    39. mingw32-make[1]: Leaving directory `D:/workspace/Qutlook'
    40. mingw32-make: *** [release-all] Error 2
    To copy to clipboard, switch view to plain text mode 

    Does anyone have the same problem as me when compiling this example?

    Thanks for your help.

    PS : Office Outlook 2003 is installed on my computer.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can't compile the Qutlook example

    I suggest you report that to Trolltech using the task-tracker.

  3. #3
    Join Date
    Jun 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't compile the Qutlook example

    I have the same problem, 3 years after.
    But I don't see any similar problems on the net.
    Then I am in doubt with the usage of this functionality.

  4. #4
    Join Date
    Jun 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't compile the Qutlook example

    I have found a solution !

    "Enums cannot be forward declared. First of all the C++ standard does not define forward declaration. It defines incomplete types." (from http://bytes.com/topic/c/answers/622...claration-enum)

    So, gcc/mingw is right, and doesn't compile this source.
    It is a bug, perhaps in the msoutl.olb file, perhaps in the dumpcpp tool (I don't know why, but I think it is from the olb file)

    If you don't intend to use this enum, you can easily define it BEFORE the inclusion of the msoutl.h file, like this:

    Qt Code:
    1. namespace Office { enum MsoFeatureInstall { value }; }
    2.  
    3. //! [0]
    4. #include "addressview.h"
    5. #include "msoutl.h"
    6. #include <QtGui>
    7. ....
    To copy to clipboard, switch view to plain text mode 

    Yours, J..
    Last edited by tokii; 24th June 2010 at 20:53.

  5. #5
    Join Date
    Jun 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't compile the Qutlook example

    I don't know why it worked; it didn't recompile the msoutl.cpp, but it is not correct and doesn't work.
    I think it is a bug in the dumpcpp tool, and opened a bug in their bug tracking tool: http://bugreports.qt.nokia.com/browse/QTBUG-11721

    So, no resolution, for yet.

  6. #6
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't compile the Qutlook example

    Hi guys. You are quite correct. Enums can not be passed from COM server. All data is via class declarations. The problem is caused by -gccdump incorrectly creating msoutl.h, but the answer is simple.
    Open msoutl.h in editor and change line - "enum MsoFeatureInstall;" - to "class MsoFeatureInstall;"

    #include <qdatetime.h>
    #include <qpixmap.h>

    struct IDispatch;

    // Referenced namespace
    namespace Office {
    class Assistant;
    class COMAddIns;
    class LanguageSettings;
    class AnswerWizard;
    class MsoFeatureInstall; *** changed from - enum MsoFeatureInstall;
    class CommandBars;
    }

    .............................

  7. #7
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can't compile the Qutlook example

    Sorry guys

    First assumptions not quite right. Enum is required and needs to be declared prior to forward declaration. Try this. It does compile now.

    // Referenced namespace
    namespace Office {

    enum MsoFeatureInstall {
    msoFeatureInstallNone = 0,
    msoFeatureInstallOnDemand = 1,
    msoFeatureinstallOnDemandWithUI = 2
    };

    // forward declarations
    class Assistant;
    class COMAddIns;
    class LanguageSettings;
    class AnswerWizard;
    enum MsoFeatureInstall;
    class CommandBars;
    }

Similar Threads

  1. Use VC2005 to compile Qt program (4.3.0)
    By firegun9 in forum Qt Programming
    Replies: 3
    Last Post: 8th June 2007, 16:04
  2. Qt-4.2.2 qmake won't compile under visual studio 2005 on vista
    By moowy in forum Installation and Deployment
    Replies: 7
    Last Post: 13th January 2007, 21:06
  3. Need to compile with MySQL drivers/plugins
    By mongenix in forum Newbie
    Replies: 5
    Last Post: 6th January 2007, 20:24
  4. Compile Errors
    By luffy27 in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2006, 05:26
  5. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.