zerotier / libzt

Encrypted P2P sockets over ZeroTier

Home Page:https://zerotier.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static linking the library

opened this issue · comments

Can't manage to build any c++ project by including links in the output binary.

I do manage to build libzt.lib on Windows x64 and get that file in the /dist folder. However when trying to simply build of a "hello world" (just a socket that sends this to another node) by linking with libzt.lib, I get a lot of LNK2001 errors:

Error	LNK2001	unresolved external symbol __imp_zts_util_delay	source
Error	LNK2001	unresolved external symbol __imp_zts_socket	source
[... snip ...]
Error	LNK2001	unresolved external symbol __imp_zts_bsd_fcntl	source
[... snip ...]

So I get 20 of these linking errors when linking only with libzt.lib; however to be able to build the app I have to link against zt-shared.lib also. I don't want the shared library and neither want to provide a .dll with the final build. I don't understand why it's necessary to have this zt-shared.lib since you can only find it in /cache folder. Is this intended? Is there a way to include all the symbols in the libzt.lib only? Or have an option in the CMakeFiles to link statically or dynamically?

Thanks!