Results 1 to 10 of 10

Thread: executing g++ command with qt

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    15
    Thanked 16 Times in 15 Posts

    Default executing g++ command with qt

    I want to compile the following command with qt:
    Qt Code:
    1. #g++ -o main main.cpp -I /opt/intel/ipp/include -I /opt/intel/composer_xe_2013_sp1/mkl/include
    2. #-L /opt/intel/ipp/lib/ia32 -L /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32
    3. #-lippi -lipps -lippcore -lpthread -lm -lmkl_rt
    To copy to clipboard, switch view to plain text mode 

    I know about
    Qt Code:
    1. LIBS += -lippi -lipps -lippcore -lpthread -lm -lmkl_rt
    To copy to clipboard, switch view to plain text mode 

    but what about the libraries and include paths?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: executing g++ command with qt

    What is the actual question?
    What do you mean by "with qt"?
    If the code you are compiling main.cpp does not depend on Qt, then there is no need to specify any Qt dependency...
    But then again, I didn't really understand you question.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    15
    Thanked 16 Times in 15 Posts

    Default Re: executing g++ command with qt

    Quote Originally Posted by high_flyer View Post
    What is the actual question?
    What do you mean by "with qt"?
    If the code you are compiling main.cpp does not depend on Qt, then there is no need to specify any Qt dependency...
    But then again, I didn't really understand you question.
    you misunderstood me. I can compile the code successfully with the above command(forget about qt). Now, I want to open the code with qt IDE and add the include paths n libraries to it. I only added LIBS += values as I mentioned above. However, I get error and don't know how to set the -I include parameters and -L libraries from the command above.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: executing g++ command with qt

    Use the INCLUDEPATH variable.
    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.


  5. #5
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    15
    Thanked 16 Times in 15 Posts

    Default Re: executing g++ command with qt

    I added the variables as following, the program ran once and gave results, but in the next run it gives same include file error. As I am not sure about the structure, I post them here:

    Qt Code:
    1. LIBS += -lippi -lipps -lippcore -lpthread -lm -lmkl_rt -L/opt/intel/composer_xe_2013_sp1/mkl/lib/ia32 -L/opt/intel/ipp/lib/ia32
    2.  
    3. INCLUDEPATH += -I/opt/intel/ipp/include -I/opt/intel/composer_xe_2013_sp1/mkl/include
    4.  
    5. #g++ -o main main.cpp -I /opt/intel/ipp/include -I /opt/intel/composer_xe_2013_sp1/mkl/include
    6. #-L /opt/intel/ipp/lib/ia32 -L /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32
    7. #-lippi -lipps -lippcore -lpthread -lm -lmkl_rt
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: executing g++ command with qt

    Try the INCLUDEPATH content without the -I, i.e. just the paths

    Cheers,
    _

  7. #7
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    15
    Thanked 16 Times in 15 Posts

    Default Re: executing g++ command with qt

    Quote Originally Posted by anda_skoa View Post
    Try the INCLUDEPATH content without the -I, i.e. just the paths

    Cheers,
    _
    I am sorry, but I did not get the result yet:
    LIBS += /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32 -lmkl_rt /opt/intel/ipp/lib/ia32 -lippi -lipps -lippcore -lpthread -lm
    INCLUDEPATH += /opt/intel/ipp/include /opt/intel/composer_xe_2013_sp1/mkl/include
    error: cannot find /opt/intel/composer_xe_2013_sp1/mkl/lib/ia32: File format not recognized
    error: cannot find -lmkl_rt
    error: cannot find /opt/intel/ipp/lib/ia32: File format not recognized
    error: cannot find -lippi
    error: cannot find -lipps
    error: cannot find -lippcore
    error: collect2: ld returned 1 exit status

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: executing g++ command with qt

    Probably because you were supposed to do that with contents of INCLUDEPATH and not LIBS.
    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.


  9. #9
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    15
    Thanked 16 Times in 15 Posts

    Default Re: executing g++ command with qt

    correct format:
    Qt Code:
    1. INCLUDEPATH += /opt/intel/ipp/include /opt/intel/composer_xe_2013_sp1/mkl/include
    2. LIBS += -L/opt/intel/composer_xe_2013_sp1/mkl/lib/ia32 -lmkl_rt -L/opt/intel/ipp/lib/ia32 -lippi -lipps -lippcore -lpthread -lm
    To copy to clipboard, switch view to plain text mode 

  10. #10
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: executing g++ command with qt

    I am curious why you would use qmake and GCC to compile a non-Qt program that clearly is designed to be linked with components of the Intel compiler suite?

Similar Threads

  1. Replies: 12
    Last Post: 19th July 2012, 22:22
  2. Executing linux command as root
    By stefan in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2011, 16:07
  3. Replies: 3
    Last Post: 23rd February 2011, 09:50
  4. Replies: 7
    Last Post: 15th November 2010, 10:00
  5. Replies: 4
    Last Post: 14th July 2009, 04:27

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
  •  
Qt is a trademark of The Qt Company.