Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ERROR-Definition is marked dllimport
Forum Updated to NodeBB v4.3 + New Features

ERROR-Definition is marked dllimport

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sonya
    wrote on last edited by
    #1

    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;
    }@

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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).

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved