QT and Linking Other Libraries
I started QT and trying to write some small programs. In one program, I wanted to send mail. Found a code how to send mail in C++ (uses winsock library, not QT’s) and integrated it to my program. But how, I gives some bunch of errors. They were linking errors.
... /mailer.cpp:17: undefined reference to `WSAStartup@8' ...
Then a little research helped to me: This link.
Open your project file (<projectname>.pro):
and add the line:
LIBS += < WHERE-YOUR-LIBRARY-FILE-IS-LOCATED >
If your library is located in [QTDIR]\mingw\lib directory, you can just add the name of it (without its filename extension: .a):
LIBS += libwsock32If you are developing in linux, the default library directory(or one of the library directories) might be /usr/lib.
| Print article | This entry was posted by fethilale on January 1, 2010 at 8:48 pm, and is filed under C++, QT. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
