ERROR-Definition is marked dllimport
-
Dear All,
I'm working on legacy code and trying to compile it with Qt 5.1.1 version but compiler is raising the following error for the IsTwoLineIntersect function and 3 other fuctions. Since the implementation is quite trivial I think It can be workarounded easily, but I don't know how, Any help will be appreciated,
ERROR CODE --
@D:......\MAT\Straight_Skeleton_sour\EthanMLib\Util.cpp:17: error: function 'bool IsTwoLineIntersect(const QLineF&, const QLineF&)' definition is marked dllimport
ETHANMLIB_EXPORT bool IsTwoLineIntersect( const QLineF& line1, const QLineF& line2 )
@IMPLEMENTATION OF IsTwoLineIntersect--
@
ETHANMLIB_EXPORT bool IsTwoLineIntersect( const QLineF& line1, const QLineF& line2 )
{
int nLine1Start = toLeft(line2, line1.p1());
int nLine1End = toLeft(line2, line1.p2());
if (nLine1Start * nLine1End > 0)
return false;
int nLine2Start = toLeft(line1, line2.p1());
int nLine2End = toLeft(line1, line2.p2());
if (nLine2Start * nLine2End > 0)
return false;
return true;
}@ -
If this is a shared library you are compiling check the definition of ETHANMLIB_EXPORT . It's probably something like
@
#if WHATEVER_FLAG
#define ETHANMLIB_EXPORT __declspec(dllexport)
#else
#define ETHANMLIB_EXPORT __declspec(dllimport)
#endif
@
Make sure you add the WHATEVER_FLAG to the definitions (via compiler switch or DEFINES += in your .pro file if you're using qmake).