Results 1 to 3 of 3

Thread: Qt emit keyword duplicate

  1. #1
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt emit keyword duplicate

    emit keyword conflict.
    I am building an application using Qt and a Dynamic library, but it seems the dynamic library has a function name emit.

    Function signature as as follows:
    128 std::string emit (
    129 double prep,
    130 std::string tag,
    131 int d1, int d2, int d3
    132 ){ ..... }

    I included the headers to the dynamic library in my .pri file as
    QMAKE_CXXFLAGS = -isystem/home/math/include

    I generated my makfile using: qmake myPrj.pro myPrj.pri
    in myPrj.pro is an 'include(myPrj.pri)'

    When I make I get the following error:
    line 132 error: invalid use of ::

    I have built numerous non-Qt projects using this dynamic library, in the past, no errors were ever encountered.

    Is it possible to have qmake ignore the emit keywords when including this library?


    Thanks,
    Mr. eyfout.

  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: Qt emit keyword duplicate

    Add CONFIG+=no_keywords to your project file and replace all occurences of "slots", "signals" and "emit" with "Q_SLOTS", "Q_SIGNALS" and "Q_EMIT" respectively in all your files. Remember to rerun qmake.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt emit keyword duplicate

    Or you can write a simple wrapper for this dll, that doesn't use Qt, e.g. export function my_emit, that internally calls dll's emit function

Similar Threads

  1. Inline keyword doubt and... exist outline keyword ?
    By tonnot in forum General Programming
    Replies: 4
    Last Post: 24th September 2010, 00:51
  2. Why QWindow is not initialized with the NEW keyword?
    By probine in forum Qt Programming
    Replies: 5
    Last Post: 3rd April 2010, 23:28
  3. "emit" keyword optional when calling signals?
    By will49 in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2008, 02:13
  4. Replies: 2
    Last Post: 29th May 2006, 11:46

Tags for this Thread

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.