PDA

View Full Version : includes problems



valy12
12th April 2011, 14:36
Hello everybody!
I work on Windows Seven with Qt 4.6.3

I 've got some files of a project found on the internet and I tried to create a new projet based on those files, so I 've created a .pro file and added all the files. But after compiling, I've got a problem on a library called qLocalSocket. The compile output give me the error : "No such file or directory", however, I 've got this line on my file: # include <QLocalSocket> so it should works...
Moreover I've well changed the Path of qmake.exe on system...
I've searched on the web a similar problem without succes :(

Is there something to do i've missed or what? :confused:
Thanks :)

wysota
12th April 2011, 14:38
A header file only contains a declaration of classes and functions. To use them you need to link your program against a library that provides implementations of those symbols, in your case probably the QtNetwork library.

Zlatomir
12th April 2011, 14:47
QLocalSocket class is part of the QtNetwork (http://doc.trolltech.com/4.7-snapshot/qtnetwork.html) module of Qt framework and to tell the tools to link network module with your application you will need to add this line in your .pro file:

QT += network

valy12
12th April 2011, 14:57
Ok, it works. Thanks for reply :)