Type incomplete when using __declspec(dllexport) via macros
Hi,
When using __declspec(dllexport) via macros, i get the following error from Resharper: "Type 'xxxxx' is incomplete"
If i substitute the macro with __declspec(dllexport) the error is gone.
Also, when I define the MOLD_API macro as __declspec(dllexport) the error is gone.
MOLD_API is defined as follows:
#define MOLD_API Q_DECL_EXPORT
Using Visual Studio 2015. The compiler has no complaints.
Regards,
Ruud
Please sign in to leave a comment.
Hi Ruud,
This error means that R++ does not see the definition of the Q_DECL_EXPORT macro, which should be defined in the QtCore\qcompilerdetection.h header. Does this error occur in a header or in a .cpp file? If it's in the header, is it included anywhere? How do you include Qt headers into your project? Does R++ have problems with other macros/classes from Qt?
It would be great if you could attach a minimized solution with a repro for the issue so we could take a look.
Thanks for the report!
Hi,
Thanks for your reply.
After some investigation it turns out that it has nothing to do with __declspec. So apologies for the incorrect title.
However..attached is a VS2015 solution which reproduces the problem. It seems as if Resharper does not handle include paths correctly which do not start with "C:"
If i use
\Qt\5.5.1\5.5\msvc2013\include\QtCore
instead of
C:\Qt\5.5.1\5.5\msvc2013\include\QtCore
I get the Resharper error (while it compiles perfectly)
I use CMake to generate solution/project files so not all include paths start with C:
Regards,
Ruud
Attachment(s):
ResharperDeclSpecTest.zip
Thanks for diagnosing the problem and for the repro case! This issue is tracked as https://youtrack.jetbrains.com/issue/RSCPP-15491 and will be fixed in the next public build.
Thank you for creating the issue at your side!