PDA

View Full Version : How to link to .o object file in a QT project



dexterkd
13th October 2010, 12:58
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,

squidge
13th October 2010, 13:13
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.

dexterkd
13th October 2010, 14:58
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?

tbscope
13th October 2010, 15:14
That doesn't matter.

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