When linking Wt as static libraries, you'll have to specify all
dependent libraries in your linking command. In this case, you're
looking for the winsock2 library (Ws2_32.lib), but lateron you'll also
notice that you need a number of boost libraries, and possibly others
(zlib, openssl, graphicsmagick, ..., depending on your configuration).
You must specify them all manually when using static libraries.

Wim.

2011/7/18 Виктор Прун <[email protected]>:
> Hello. I have encountered a problem during wt programming. I have the
> following code
>
> #include <Wt/WString>
>
> int main()
> {
>   Wt::WString a;
> }
>
> I have wtd.lib and wthttpd.lib added to additional dependencies my visual
> studio project. But however when i am trying to build it i get tons of link
> errors:
>
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__closesocket@4 referenced in function "void __cdecl Wt::`anonymous
>> namespace'::Close(int)" (?Close@?A0xc0c53486@Wt@@YAXH@Z)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__ioctlsocket@12 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__accept@12 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__connect@12 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__htons@4 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__listen@8 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__ntohs@4 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__ntohl@4 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__getsockname@12 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__bind@12 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__htonl@4 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__setsockopt@20 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__socket@12 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::createSocketPair(void)"
>> (?createSocketPair@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__sendto@24 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::interruptThread(void)"
>> (?interruptThread@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__recvfrom@24 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::threadEntry(void)"
>> (?threadEntry@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> ___WSAFDIsSet@8 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::threadEntry(void)"
>> (?threadEntry@SocketNotifier@Wt@@AAEXXZ)
>> wtd.lib(SocketNotifier.obj) : error LNK2019: unresolved external symbol
>> __imp__select@20 referenced in function "private: void __thiscall
>> Wt::SocketNotifier::threadEntry(void)"
>> (?threadEntry@SocketNotifier@Wt@@AAEXXZ)
>
> I had created more complicated Wt example before and it worked just fine.
> But now i can't even imagine what is wrong.
> Thanks.
>
> ------------------------------------------------------------------------------
> AppSumo Presents a FREE Video for the SourceForge Community by Eric
> Ries, the creator of the Lean Startup Methodology on "Lean Startup
> Secrets Revealed." This video shows you how to validate your ideas,
> optimize your ideas and identify your business strategy.
> http://p.sf.net/sfu/appsumosfdev2dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to