PDA

View Full Version : How to add external Header files and libraries?



askbapi
17th April 2010, 04:55
Hi,

I m using QT Creator (QT 4) for learning QT.

I need to include some external header files and libraries to my project. How can i do that?

Lykurg
17th April 2010, 07:37
simply include the header files of the library via
#include "/path/to/library/header.h" and then use LIBS in your *.pro file. See the documentation for more info.

gurmukh
19th August 2010, 07:58
http://doc.trolltech.com/4.6/qmake-project-files.html

Sabre Runner
5th September 2010, 14:53
I've read about this on line and I can't seem to get the hang of it. I have directory full of h, lib and dll files that I need linked with my code. How do I get Qt to use all of them?

wysota
5th September 2010, 17:43
header files: include them in your code
lib files: add LIBS += -l<libname> to .pro file of your project
dll files: these are not required for compilation.

shuawinn
30th September 2010, 17:04
What if I wish to add a .dll file to my project rather than a .lib? It doesn't seem to recognize that format.

Timoteo
30th September 2010, 17:33
You don't. Your project relies on X.lib which in turns relies on X.dll. Your project does not need X.dll to compile, only for execution.