Results 1 to 4 of 4

Thread: How to link to .o object file in a QT project

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

    Default How to link to .o object file in a QT project

    Hi,

    I created a QT project and I want to link it against a third party's .o object file. Could anyone help me in the right syntax that must be put in the QT project file.

    Thanks,

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to link to .o object file in a QT project

    You would first need to confirm that the object code is for the same architecture and compatible with the linker you are using. For example, Microsoft C++ has a different object code format than GCC.

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

    Default Re: How to link to .o object file in a QT project

    The object is xxx.o which is compiled on a linux machine with the same version of g++, regardless, this was not my question, my question is how to include and link this xxx.o object file in QT project file.

    Forexample, when I link to an object I usually write: LIBS += -L/usr/local/lib -lmath
    But this is not the case since my object file is neither ".a" nor ".so".

    Anybody has an idea?

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to link to .o object file in a QT project

    That doesn't matter.

    Just use LIBS += /home/you/yourobject.o

  5. The following user says thank you to tbscope for this useful post:

    dexterkd (15th October 2010)

Similar Threads

  1. Replies: 11
    Last Post: 26th May 2010, 06:33
  2. Replies: 2
    Last Post: 20th May 2010, 10:40
  3. How to link GLUT to Qt Project?
    By Lawand in forum Newbie
    Replies: 5
    Last Post: 20th March 2010, 21:29
  4. Replies: 4
    Last Post: 4th February 2010, 17:21
  5. Replies: 1
    Last Post: 4th December 2009, 00:34

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.