Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asio standalone with MSVC and Windows Store target #181

Open
remusrg opened this issue Feb 7, 2017 · 0 comments
Open

Asio standalone with MSVC and Windows Store target #181

remusrg opened this issue Feb 7, 2017 · 0 comments

Comments

@remusrg
Copy link

remusrg commented Feb 7, 2017

Hey guys, I am having linking issues with Visual Studio 2015 (update 3) when building a Universal Windows DLL that uses this library. I downloaded the version straight from master and I am using the following switches in a header file before including anything else:

#define ASIO_WINDOWS_APP
#define ASIO_HEADER_ONLY
#define ASIO_STANDALONE

The link issue seems to be related to the win_tss_ptr_create function, which by the looks of it only gets included if ASIO_WINDOWS. There's some code somewhere looks like that is still referring to this when ASIO_WINDOWS_APP? Anyway, here's the dump from the linker:

1>BroadcastServer.obj : error LNK2019: unresolved external symbol __imp__TlsAlloc@0 referenced in function "unsigned long __cdecl asio::detail::win_tss_ptr_create(void)" (?win_tss_ptr_create@detail@asio@@Yakxz)
1>BroadcastServer.obj : error LNK2019: unresolved external symbol __imp__TlsGetValue@4 referenced in function "public: __thiscall asio::detail::win_tss_ptr<class asio::detail::call_stack<class asio::detail::thread_context,class asio::detail::thread_info_base>::context>::operator class asio::detail::call_stack<class asio::detail::thread_context,class asio::detail::thread_info_base>::context *(void)const " (??B?$win_tss_ptr@Vcontext@?$call_stack@Vthread_context@detail@asio@@Vthread_info_base@23@@detail@asio@@@detail@asio@@QBEPAVcontext@?$call_stack@Vthread_context@detail@asio@@Vthread_info_base@23@@12@XZ)
1>BroadcastServer.obj : error LNK2019: unresolved external symbol __imp__TlsFree@4 referenced in function "public: __thiscall asio::detail::win_tss_ptr::~win_tss_ptr(void)" (??1?$win_tss_ptr@Ucontext_impl@system_executor@asio@@@detail@asio@@QAE@XZ)

For context, I am using this library indirectly via websocketpp, with the following includes/defines:

#define WEBSOCKETPP_CPP11_STL

#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/common/thread.hpp>
#include <websocketpp/server.hpp>

Any idea how I can fix this? Seems to be related to something within asio, not websocketpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant