Giter Club home page Giter Club logo

Comments (10)

sdamm avatar sdamm commented on July 23, 2024

The error you get does not show where it actually occurred,
it seems to be in the boost\asio\detail\win_static_mutex.hpp header. But i would suspect
a missing include/define but to be certain it would be good if you had a Verbose build showing
what file is actually compiled.

I noticed in your Makefile you have: -UBOOST_ASIO_WINDOWS
Shouldn't that be a -DBOOST_ASIO_WINDOWS ?

from asio_dtls.

VPBalaRama avatar VPBalaRama commented on July 23, 2024

Hi,
Thanks for Immediate response.
I was getting that error while compiling the \boost\asio\ssl\dtls\detail\impl\engine.ipp file. I was getting a bunch of error in boost/asio/detail/win_static_mutex.hpp and win_static_mutex.ipp files.
Below i have shared sample errors.
c:\test\releases\projDTLS\3rdparty\boost\boost\asio\detail\win_static_mutex.hpp(55): error C2039: 'CRITICAL_SECTION': is not a member of '`global namespace'' (compi
ling source file C:\test\Releases\projDTLS\3rdparty\boost\boost\asio\ssl\dtls\detail\impl\engine.ipp) [C:\test\Releases\projDTLS\build\3rdparty\boost\boost\a
sio\ssl\dtls\boost_dtls.vcxproj]
c:\test\releases\projDTLS\3rdparty\boost\boost\asio\detail\win_static_mutex.hpp(55): error C3646: 'crit_section_': unknown override specifier (compiling source file
C:\test\Releases\projDTLS\3rdparty\boost\boost\asio\ssl\dtls\detail\impl\engine.ipp) [C:\test\Releases\projDTLS\build\3rdparty\boost\boost\asio\ssl\dtls\boo
st_dtls.vcxproj]

To avoid above error i have added -UBOOST_ASIO_WINDOWS macro. still no efftective.
I have commented out below lines in detail/static_mutex.hpp. Now its compiling succusfully. is this good way or what?

#if !defined(BOOST_ASIO_HAS_THREADS)
#include <boost/asio/detail/null_static_mutex.hpp>
//#elif defined(BOOST_ASIO_WINDOWS)//commented by v2
//# include <boost/asio/detail/win_static_mutex.hpp> //commneted by v2

#elif defined(BOOST_ASIO_HAS_PTHREADS)
#include <boost/asio/detail/posix_static_mutex.hpp>
#elif defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
#include <boost/asio/detail/std_static_mutex.hpp>
#else
#error Only Windows and POSIX are supported!
#endif

#if !defined(BOOST_ASIO_HAS_THREADS)
typedef null_static_mutex static_mutex;
#define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_NULL_STATIC_MUTEX_INIT
//#elif defined(BOOST_ASIO_WINDOWS) //commented by v2
//typedef win_static_mutex static_mutex;//commented by v2
//# define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_WIN_STATIC_MUTEX_INIT //comment

#elif defined(BOOST_ASIO_HAS_PTHREADS)
typedef posix_static_mutex static_mutex;
#define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_POSIX_STATIC_MUTEX_INIT
#elif defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
typedef std_static_mutex static_mutex;
#define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_STD_STATIC_MUTEX_INIT
#endif

from asio_dtls.

VPBalaRama avatar VPBalaRama commented on July 23, 2024

After above library compilation.. now linker error with the library. Please let me know how to link library.
main.obj : error LNK2019: unresolved external symbol _BIO_free referenced in function "public: __thiscall boost::asio::ssl::dtls::detail::engine::~engine(void)" (??1engine
@detail@dtls@ssl@asio@boost@@QAE@XZ) [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\async_client\example_boost_async_client.
vcxproj]
client.obj : error LNK2001: unresolved external symbol _BIO_free [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\async_client
\example_boost_async_client.vcxproj]
main.obj : error LNK2019: unresolved external symbol _CONF_modules_unload referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::
~do_init(void)" (??1do_init@openssl_init_base@detail@ssl@asio@boost@@QAE@XZ) [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost
async_client\example_boost_async_client.vcxproj]
client.obj : error LNK2001: unresolved external symbol _CONF_modules_unload [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\a
sync_client\example_boost_async_client.vcxproj]
main.obj : error LNK2019: unresolved external symbol _SSL_CTX_set_options referenced in function "public: class boost::system::error_code __thiscall boost::asio::ssl::dtls
::context::set_options(long,class boost::system::error_code &)" (?set_options@context@dtls@ssl@asio@boost@@QAE?AVerror_code@system@5@JAAV675@@z) [C:\Kodiak\Releases\LMR-GW
-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\async_client\example_boost_async_client.vcxproj]
main.obj : error LNK2019: unresolved external symbol _SSL_CTX_new referenced in function "public: __thiscall boost::asio::ssl::dtls::context::context(enum boost::asio::ssl
::dtls::context::dtls_method)" (??0context@dtls@ssl@asio@boost@@QAE@W4dtls_method@01234@@z) [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src
examples\boost\async_client\example_boost_async_client.vcxproj]
main.obj : error LNK2019: unresolved external symbol _SSL_CTX_free referenced in function "public: __thiscall boost::asio::ssl::dtls::context::~context(void)" (??1context@
dtls@ssl@asio@boost@@QAE@XZ) [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\async_client\example_boost_async_client.vcxproj]
main.obj : error LNK2019: unresolved external symbol _SSL_CTX_set_default_passwd_cb_userdata referenced in function "public: __thiscall boost::asio::ssl::dtls::context::~c
ontext(void)" (??1context@dtls@ssl@asio@boost@@QAE@XZ) [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\async_client\example_b
oost_async_client.vcxproj]
main.obj : error LNK2019: unresolved external symbol _SSL_CTX_get_default_passwd_cb_userdata referenced in function "public: __thiscall boost::asio::ssl::dtls::context::~c
ontext(void)" (??1context@dtls@ssl@asio@boost@@QAE@XZ) [C:\Kodiak\Releases\LMR-GW-R9.1.1\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\async_client\example_b
oost_async_client.vcxproj]
main.obj : error LNK2019: unresolved external symbol _SSL_free referenced in fun

from asio_dtls.

sdamm avatar sdamm commented on July 23, 2024

_BIO_free is part of OpenSSL, so you probably don't link it correctly.

from asio_dtls.

VPBalaRama avatar VPBalaRama commented on July 23, 2024

Hi
I am getting below error, when i try to compile. please let me know hoe to fix it dtls\src\examples\boost\server\example_boost_server
main.cpp
c:\proj\releases\dtls\3rdparty\boost\boost\asio\detail\io_object_impl.hpp(87): error C2039: 'get_executor': is not a member of 'boost::asio::execution_context' [C:\proj\Releases\dtls\build\3rdparty\boost\boost\asio\ssl\dtls\src\examples\boost\server\example_boost_server.vcxproj]
c:\proj\releases\dtls\3rdparty\boost\boost\asio\execution_context.hpp(106): note: see declaration of 'boost::asio::execution_context'
c:\proj\releases\dtls\3rdparty\boost\boost\asio\basic_socket.hpp(133): note: see reference to function template instantiation 'boost::asio::detail::io_object_impl<boost::asio::detail::win_iocp_socket_service,Executor>::io_object_impl(ExecutionContext &,void *)' being compiled
with
[
Protocol=boost::asio::ip::udp,
Executor=boost::asio::executor,
ExecutionContext=boost::asio::execution_context
]
c:\proj\releases\dtls\3rdparty\boost\boost\asio\basic_socket.hpp(132): note: see reference to function template instantiation 'boost::asio::detail::io_object_impl<boost::asio::detail::win_iocp_socket_service,Executor>::io_object_impl(ExecutionContext &,void *)' being compiled
with
[
Protocol=boost::asio::ip::udp,
Executor=boost::asio::executor,
ExecutionContext=boost::asio::execution_context
]
c:\proj\releases\dtls\3rdparty\boost\boost\asio\basic_datagram_socket.hpp(108): note: see reference to function template instantiation 'boost::asio::basic_socket<Protocol,Executor>::basic_socket(ExecutionContext &,void *)' being compiled
with
[
Protocol=boost::asio::ip::udp,
Executor=boost::asio::executor,
ExecutionContext=boost::asio::execution_context
]
c:\proj\releases\dtls\3rdparty\boost\boost\asio\basic_datagram_socket.hpp(107): note: see reference to function template instantiation 'boost::asio::basic_socket<Protocol,Executor>::basic_socket(ExecutionContext &,void *)' being compiled
with

from asio_dtls.

sdamm avatar sdamm commented on July 23, 2024

I don't have a windows system for building available at the moment (maybe on Monday).
What you could try is the ASIO_HEADER_ONLY define.
Also I have only tested with Boost 1.70 so I'm not certain this
works at the moment.

from asio_dtls.

VPBalaRama avatar VPBalaRama commented on July 23, 2024

Hi,
Thanks for Immediate response.
I was getting that error while compiling the \boost\asio\ssl\dtls\detail\impl\engine.ipp file. I was getting a bunch of error in boost/asio/detail/win_static_mutex.hpp and win_static_mutex.ipp files.
Below i have shared sample errors.
c:\test\releases\projDTLS\3rdparty\boost\boost\asio\detail\win_static_mutex.hpp(55): error C2039: 'CRITICAL_SECTION': is not a member of '`global namespace'' (compi
ling source file C:\test\Releases\projDTLS\3rdparty\boost\boost\asio\ssl\dtls\detail\impl\engine.ipp) [C:\test\Releases\projDTLS\build\3rdparty\boost\boost\a
sio\ssl\dtls\boost_dtls.vcxproj]
c:\test\releases\projDTLS\3rdparty\boost\boost\asio\detail\win_static_mutex.hpp(55): error C3646: 'crit_section_': unknown override specifier (compiling source file
C:\test\Releases\projDTLS\3rdparty\boost\boost\asio\ssl\dtls\detail\impl\engine.ipp) [C:\test\Releases\projDTLS\build\3rdparty\boost\boost\asio\ssl\dtls\boo
st_dtls.vcxproj]

To avoid above error i have added -UBOOST_ASIO_WINDOWS macro. still no efftective.
I have commented out below lines in detail/static_mutex.hpp. Now its compiling succusfully. is this good way or what?

#if !defined(BOOST_ASIO_HAS_THREADS)
#include <boost/asio/detail/null_static_mutex.hpp>
//#elif defined(BOOST_ASIO_WINDOWS)//commented by v2 //# include <boost/asio/detail/win_static_mutex.hpp> //commneted by v2
#elif defined(BOOST_ASIO_HAS_PTHREADS)
#include <boost/asio/detail/posix_static_mutex.hpp>
#elif defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
#include <boost/asio/detail/std_static_mutex.hpp>
#else
#error Only Windows and POSIX are supported!
#endif

#if !defined(BOOST_ASIO_HAS_THREADS)
typedef null_static_mutex static_mutex;
#define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_NULL_STATIC_MUTEX_INIT
//#elif defined(BOOST_ASIO_WINDOWS) //commented by v2 //typedef win_static_mutex static_mutex;//commented by v2 //# define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_WIN_STATIC_MUTEX_INIT //comment
#elif defined(BOOST_ASIO_HAS_PTHREADS)
typedef posix_static_mutex static_mutex;
#define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_POSIX_STATIC_MUTEX_INIT
#elif defined(BOOST_ASIO_HAS_STD_MUTEX_AND_CONDVAR)
typedef std_static_mutex static_mutex;
#define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_STD_STATIC_MUTEX_INIT
#endif

I have to prepare cmake file without the comment. can you please comment on this.

from asio_dtls.

sdamm avatar sdamm commented on July 23, 2024

I have tried to compile asio_dtls using:

  • Windows 10
  • Visual Studio 2019
  • boost 1.72.0
  • openssl 1.1.1f

And after fixing the linkage of boost i have the error in

  • dtls\src\examples\boost\server\example_boost_server

It seems there is an error in the dtls::acceptor .
If you don't need this functionality you can just disable the server example.
I can't say when i will have a fix as i haven't understood what the cause is,
but i will try to get it fixed.

from asio_dtls.

sdamm avatar sdamm commented on July 23, 2024

With the latest Commit (c578c3e) i could successfully compile asio_dtls and the boost examples.

cmake call:
cmake -DOPENSSL_ROOT_DIR=C:\Libraries\openssl-vc -DBOOST_ROOT=C:\Libraries\boost_1_72_0 -DBoost_USE_STATIC_LIBS=ON -Dasio_dtls_use_boost=ON ..

Assuming the libraries are located in the respective Directories and you have a static built Boost.
And .. is the path to the asio_dtls source.

from asio_dtls.

sdamm avatar sdamm commented on July 23, 2024

I assume this has been fixed, so I'm closing the issue.

from asio_dtls.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.