PDA

View Full Version : Can't compile the Qutlook example



Matt84
30th August 2007, 10:33
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 :


mingw32-make all
mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory `D:/workspace/Qutlook'
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
In file included from addressview.cpp:39:
addressview.h:73:2: warning: no newline at end of file
In file included from addressview.cpp:40:
msoutl.h:30: error: use of enum `MsoFeatureInstall' without previous declaration
msoutl.h:867: error: ISO C++ forbids declaration of `MsoFeatureInstall' with no type
msoutl.h:867: error: invalid use of `::'
msoutl.h:867: error: `MsoFeatureInstall' declared as an `inline' field
msoutl.h:867: error: expected `;' before "FeatureInstall"
msoutl.h:868: error: variable or field `SetFeatureInstall' declared void
msoutl.h:868: error: `SetFeatureInstall' declared as an `inline' field
msoutl.h:868: error: expected `;' before '(' token
msoutl.h:17538: error: ISO C++ forbids declaration of `MsoFeatureInstall' with no type
msoutl.h:17538: error: invalid use of `::'
msoutl.h:17538: error: `MsoFeatureInstall' declared as an `inline' field
msoutl.h:17538: error: expected `;' before "FeatureInstall"
msoutl.h:17539: error: variable or field `SetFeatureInstall' declared void
msoutl.h:17539: error: `SetFeatureInstall' declared as an `inline' field
msoutl.h:17539: error: expected `;' before '(' token
msoutl.h:24992: error: expected init-declarator before "_Application"
msoutl.h:24992: error: expected `,' or `;' before "_Application"
msoutl.h:24998: error: variable or field `SetFeatureInstall' declared void
msoutl.h:24998: error: `Outlook::_Application::SetFeatureInstall' declared as an `inline' variable
msoutl.h:24998: error: `int Outlook::_Application::SetFeatureInstall' is not a static member of `class Outlook::_Application'
msoutl.h:24998: error: `MsoFeatureInstall' is not a member of `Office'
msoutl.h:24998: error: expected `,' or `;' before '{' token
msoutl.h:42174: error: expected init-declarator before "Application"
msoutl.h:42174: error: expected `,' or `;' before "Application"
msoutl.h:42180: error: variable or field `SetFeatureInstall' declared void
msoutl.h:42180: error: `Outlook::Application::SetFeatureInstall' declared as an `inline' variable
msoutl.h:42180: error: `int Outlook::Application::SetFeatureInstall' is not a static member of `class Outlook::Application'
msoutl.h:42180: error: `MsoFeatureInstall' is not a member of `Office'
msoutl.h:42180: error: expected `,' or `;' before '{' token
addressview.cpp:274:2: warning: no newline at end of file
mingw32-make[1]: *** [release\addressview.o] Error 1
mingw32-make[1]: Leaving directory `D:/workspace/Qutlook'
mingw32-make: *** [release-all] Error 2

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.

wysota
19th September 2007, 11:45
I suggest you report that to Trolltech using the task-tracker.

tokii
24th June 2010, 21:09
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.

tokii
24th June 2010, 21:37
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/62285-gcc-forward-declaration-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:



namespace Office { enum MsoFeatureInstall { value }; }

//! [0]
#include "addressview.h"
#include "msoutl.h"
#include <QtGui>
....


Yours, J..

tokii
24th June 2010, 22:22
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.

ricdata
26th January 2011, 09:49
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;
}

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

ricdata
26th January 2011, 12:43
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;
}