Boost SSL with Visual Studio 2010 and OpenSSL - visual-studio-2010

I'm trying to compile the Boost 1.47 ASIO SSL server and client examples. I can sucessfully incorporate Boost into my project, but I cannot incorporate OpenSSL. When I try to add it I get the errors:
1>SSLServer.obj : error LNK2019: unresolved external symbol _ERR_reason_error_string referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall boost::asio::error::detail::ssl_category::message(int)const " (?message#ssl_category#detail#error#asio#boost##UBE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z)
1>SSLServer.obj : error LNK2019: unresolved external symbol _CRYPTO_set_id_callback referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>SSLServer.obj : error LNK2019: unresolved external symbol _CRYPTO_set_locking_callback referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>SSLServer.obj : error LNK2019: unresolved external symbol _CRYPTO_num_locks referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>SSLServer.obj : error LNK2019: unresolved external symbol _SSL_load_error_strings referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>SSLServer.obj : error LNK2019: unresolved external symbol _SSL_library_init referenced in function "public: __thiscall boost::asio::ssl::detail::openssl_init_base::do_init::do_init(void)" (??0do_init#openssl_init_base#detail#ssl#asio#boost##QAE#XZ)
1>SSLServer.obj : error LNK2019: unresolved external symbol _ENGINE_cleanup 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)
1>SSLServer.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)
1>SSLServer.obj : error LNK2019: unresolved external symbol _CRYPTO_cleanup_all_ex_data 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)
1>SSLServer.obj : error LNK2019: unresolved external symbol _EVP_cleanup 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)
1>SSLServer.obj : error LNK2019: unresolved external symbol _ERR_remove_state 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)
1>SSLServer.obj : error LNK2019: unresolved external symbol _ERR_free_strings 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)
1>C:\Users\Epicism\Documents\Visual Studio 2010\Projects\SSLServer\Debug\SSLServer.exe : fatal error LNK1120: 12 unresolved externals
1>
1>Build FAILED.
I have tried adding the directory C:\OpenSSL-Win32\lib\, C:\OpenSSL-Win32\lib\VC\, C:\OpenSSL-Win32\lib\VC\static, C:\OpenSSL-Win32\bin, C:\OpenSSL-Win32\include to Project->General Properties->Linker->Additional Library Directories using the openssl pre-compiled libraries (http://www.openssl.org/related/binaries.html). I have also tried compiling OpenSSL myself with the same errors. I'm really at a loss, I have tried everything I have searched Google about a thousand times, tried IRC, every combination of directories I can think of...
My setup is:
Windows 7 64-bit
Windows Visual Studio 2010 64 bit
Boost 1.47
OpenSSL 1.0.0E and G
C/C++ Additional Include Directories: C:\Program Files (x86)\boost\boost_1_47;C:\openssl\include\;C:\OpenSSL-Win32\lib;%(AdditionalIncludeDirectories)
Project->General Properties->Linker->Additional Library Directories: C:\Program Files (x86)\boost\boost_1_47\lib;C:\openssl\lib;C:\openssl;%(AdditionalLibraryDirectories)
- I've tried adding every directory to this property as well....
Right now I'm just trying to compile the following in a VS C++ console project:
// SSLServer.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
Thanks in advance.

Looks like you're using the 32-bit version of OpenSSL on a 64-bit machine.
Try downloading the 64-bit version (Win64 OpenSSL v1.0.0g) from http://www.slproweb.com/products/Win32OpenSSL.html
After that's installed (if you use default paths), you should have a C:\OpenSSL-Win64 folder.
You should add:
C:\OpenSSL-Win64\include to your Additional Include Directories
C:\OpenSSL-Win64\lib\VC\static or C:\OpenSSL-Win64\lib\VC to your Additional Library Directories depending on whether you want the static libs or the dlls respectively
libeay32<XXX>.lib and ssleay32<XXX>.lib to Additional Dependencies where <XXX> matches whatever setting you have for [C/C++]->[Code Generation]->[Runtime Library]

I managed to get your little program above to build by linking with the 32-bit version of the Boost library along with the 32-bit version of OpenSSL. You will also need the 32-bit version of the redistributables as well. The bug is present in Boost version 1.51 and 1.52, which are the only versions I tested.
I believe there is a bug in the 64-bit version of the ASIO library. Although, it is possible that it is some sort of configuration problem that has affected many others. I have submitted a Boost bug report about the issue.

I met with the similar issue(VS2010), solved methods:
1)Properties->C/C++ ->general->additional include Directories: yourpath\boost_1_58_0\boost_1_58_0 (I use 1.58.0 version)
2)Properties->Linker ->general->additional library directories:
yourpath\boost_1_58_0\boost_1_58_0\stage\lib
3)Properties->Linker ->Input ->additional Dependencies:
libeay32.lib
ssleay32.lib
These two .lib files are copied from openssl install directory.

Related

Redifining C/C++ entry point in Microsoft Visual Studio 2015

Here's the thing, guys:
I've got a trouble trying to make the entry point of my program not called main
Earlier, in Visual Studio 2012 that was pretty easy - I just used /ENTRY key of linker or the same setting of my project (Project->'project_name' properties...->Linker->Advanced->Entry Point) and it worked properly: say, I had a function like this:
int LetsRock
{
...
return 0;
}
And I needed, as described above, just set /ENTRY:LetsRock and it ran first.
But in Microsoft Visual Studio 2015 Enterprise Version 14.0.25123.00 Update 2 things turn out quite strange:
As soon as I redefine the entrypoint, compiler gives me the bunch of 11 errors (actually 10, 'cause 11th only says, that there are 10 errors):
Here they are, for those, who don't wanna open the picture:
1>------ Build started: Project: Tester, Configuration: Debug Win32 ------
1> Source.c
1>MSVCRTD.lib(_init_.obj) : error LNK2019: unresolved external symbol __CrtDbgReport referenced in function __CRT_RTC_INIT
1>MSVCRTD.lib(_init_.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function __CRT_RTC_INITW
1>MSVCRTD.lib(_error_.obj) : error LNK2019: unresolved external symbol ___stdio_common_vsprintf_s referenced in function __vsprintf_s_l
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath##YAHPB_WPA_WI#Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol __wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath##YAHPB_WPA_WI#Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol _wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath##YAHPB_WPA_WI#Z)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol ___vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll##YAPAUHINSTANCE__##XZ)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol ___vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll##YAPAUHINSTANCE__##XZ)
1>MSVCRTD.lib(_pdblkup_.obj) : error LNK2019: unresolved external symbol ___vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll##YAPAUHINSTANCE__##XZ)
1>MSVCRTD.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
1>C:\<path to my folder>\Tester\Debug\Tester.exe : fatal error LNK1120: 10 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It turns out even stranger - if I set entrypoint setting to main (of course, here I also rename my function in the source file), it still doesn't work. The same set of errors.
So, the question is:How do I properly redefine the entry point of C/C++ project in Visual Studio 2015?
If this is impossible, why haven't they, finally, removed this setting?
Ok, as Hans Passant advised, I just added more .lib dependencies: vcruntimed.lib and ucrtd.lib, and it worked fine. It is compiled in Release configuration without those libs, but in this way it may not wok correctly - In my case, the program
#include <stdio.h>
int LetsRock()
{
getchar();
return 0;
}
didn't run, saying error LNK2001: unresolved external symbol __imp__getchar

Static build with PCL and OpenCV in Visual Studio 2010

I have a running project in Visual Studio 2010 using OpenCV 2.49 and Point Cloud Library 1.6 . I am trying to make a standalone executable so I don´t need to install OpenCV and PCL in other computers to make it run.
OpenCV and PCL were installed using the precompiled binaries, and PCL also included boost (1.49) and vtk (5.8) libraries, among others.
For making the static build, I changed the Runtime Library in VS to /MT. Then, some Boost static libraries were missing, so I installed boost again (version 1.56, I believe I needed the libs with the 's').
Then I had errors like:
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
so I added msvcrt.lib, msvcprt.lib to the section "Ignore Specific Defaul Libraries".
Now I have errors like:
1>vtkCommon.lib(vtkVoidArray.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(void const *)" (__imp_??6?$basic_ostream#DU?$char_traits#D#std###std##QAEAAV01#PBX#Z)
1>vtkCommon.lib(vtkVariantArray.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(void const *)" (__imp_??6?$basic_ostream#DU?$char_traits#D#std###std##QAEAAV01#PBX#Z)
1>vtkCommon.lib(vtkTimerLog.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>vtkCommon.lib(vtkMath.obj) : error LNK2001: unresolved external symbol __imp__modf
1>vtksys.lib(SystemTools.obj) : error LNK2001: unresolved external symbol __imp___utime64
1>OLDNAMES.lib(unlink.obi) : error LNK2001: unresolved external symbol __imp__unlink
The vtk library is included exactly the same way as in the non-static release build. And, if I understood it correctly, .lib is an extension for a static libray.
What am I doing wrong?
EDIT: I tried using CMake, but I am getting the same kind of errors (There are a lot more):
2>vtksys.lib(SystemTools.obj) : error LNK2019: unresolved external symbol __imp___time64 referenced in function _time
2>vtkCommon.lib(vtkVariant.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_istream<char,struct std::char_traits<char> > & __thiscall std::basic_istream<char,struct std::char_traits<char> >::operator>>(short &)" (__imp_??5?$basic_istream#DU?$char_traits#D#std###std##QAEAAV01#AAF#Z) referenced in function "short __cdecl vtkVariantStringToNumeric<short>(class vtkStdString,bool *,short *)" (??$vtkVariantStringToNumeric#F##YAFVvtkStdString##PA_NPAF#Z)
This is my CMakeList.txt:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(3DVisualizerCM)
set(BUILD_SHARED_LIBS OFF)
SET(CMAKE_EXE_LINKER_FLAGS "/NODEFAULTLIB:msvcrt.lib
/NODEFAULTLIB:msvcprt.lib")
find_package(PCL 1.4 REQUIRED)
find_package(OpenCV REQUIRED)
include_directories(${PCL_INCLUDE_DIRS} )
link_directories(${PCL_LIBRARY_DIRS} )
add_definitions(${PCL_DEFINITIONS} )
add_executable (3D_v4
3D_v4.cpp
C3DVisualizer.cpp
C3DVisualizerMultiple.cpp
C3DVisualizerSingle.cpp
CCameraParameters.cpp
CImageTrack.cpp
CImg.cpp
CImgMultiple.cpp
CImgSingle.cpp
helpers.cpp
)
target_link_libraries (3D_v4 ${PCL_LIBRARIES} ${OpenCV_LIBS})
The precompiled vtk libraries you are using from PCL must have been compiled using /MD flag (Multithreaded DLL) in Visual Studio. You need to recompile them using the /MT flag (Multithreaded static link).

Linker errors in pcp_main example from libjingle

I'm working to get libjingle working on windows7 using visual studio. I followed GYP methodology to build lib jingle and got libs after executing the libjingle.sln file.
Now, when I'm trying to run pcp_main.cc file, I got slashed with linker errors, after some work around, I was left with 5 linker errors. Can someone help me how to resolve those errors?
Error 5 error LNK1120: 4 unresolved externals C:\Users\username\documents\visual studio
2012\Projects\PCPTest\Debug\PCPTest.exe Error 3 error LNK2001:
unresolved external symbol "protected: virtual bool __thiscall
buzz::JingleInfoTask::HandleStanza(class buzz::XmlElement const *)"
(?HandleStanza#JingleInfoTask#buzz##MAE_NPBVXmlElement#2##Z) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\pcp_main.obj
Error 1 error LNK2001: unresolved external symbol "public: virtual int
__thiscall buzz::JingleInfoTask::ProcessStart(void)" (?ProcessStart#JingleInfoTask#buzz##UAEHXZ) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\pcp_main.obj
Error 2 error LNK2019: unresolved external symbol "public: void
__thiscall buzz::JingleInfoTask::RefreshJingleInfoNow(void)" (?RefreshJingleInfoNow#JingleInfoTask#buzz##QAEXXZ) referenced in
function "public: void __thiscall
AutoPortAllocator::SetXmppClient(class buzz::XmppClient *)"
(?SetXmppClient#AutoPortAllocator##QAEXPAVXmppClient#buzz###Z) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\pcp_main.obj
Error 4 error LNK2019: unresolved external symbol
_imp_InternetQueryOptionW#16 referenced in function "bool __cdecl talk_base::GetIeLanProxySettings(char const *,struct
talk_base::ProxyInfo *)"
(?GetIeLanProxySettings#talk_base##YA_NPBDPAUProxyInfo#1##Z) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\libjingle.lib(proxydetect.obj)
My include folder is pointing to
C:\Users\username\Desktop\libjingle\trunk\testing
C:\Users\username\Desktop\libjingle\trunk\
and lib folder to
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib
Additional dependencies have absolute paths of all the available libs.
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib\audio_processing_sse2.lib
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib\bitrate_controller.lib
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib\CNG.lib
...
...
...
The source codeI'm using is present here.
http://pastebin.com/GATFYWnW
Got the answer!
The Error 4 can be removed by adding the following line
#pragma comment(lib, "Wininet.lib")
The remaining errors correspond to the jingleInfoTask.cc and JingleInfotask.h files. Its a bit surprise to see that the solution file (libjingle.sln) doesnt have these files when it built libraries. The work around would be to add the jingleinfotask.cc and jingleinfotask.h files into xmpp folder and re-build the libjingle.sln file.
This will produce the jingleinfotask.obj and required lib files. Make sure you point the generated lib file in the additional dependencies section in linker section of project properties.

Linking errors when building against Boost Unit Test Framework

I am trying to use Boost Unit Test Framework by building a stand alone library as detailed here:
http://www.boost.org/doc/libs/1_35_0/libs/test/doc/components/utf/compilation.html
So I created a VC library project containing the mentioned files and build it and it was successful. Then I created a test project and referenced the library project I just created, but when I tried to build it, I got the following linking errors:
1>Type.obj : error LNK2019: unresolved external symbol "bool __cdecl boost::test_tools::tt_detail::check_impl(class boost::test_tools::predicate_result const &,class boost::unit_test::lazy_ostream const &,class boost::unit_test::basic_cstring<char const >,unsigned __int64,enum boost::test_tools::tt_detail::tool_level,enum boost::test_tools::tt_detail::check_type,unsigned __int64,...)" (?check_impl#tt_detail#test_tools#boost##YA_NAEBVpredicate_result#23#AEBVlazy_ostream#unit_test#3#V?$basic_cstring#$$CBD#63#_KW4tool_level#123#W4check_type#123#3ZZ) referenced in function "public: void __cdecl test1::test_method(void)" (?test_method#test1##QEAAXXZ)
1>BoostUnitTestFramework.lib(framework.obj) : error LNK2019: unresolved external symbol "void __cdecl boost::debug::break_memory_alloc(long)" (?break_memory_alloc#debug#boost##YAXJ#Z) referenced in function "void __cdecl boost::unit_test::framework::init(class boost::unit_test::test_suite * (__cdecl*)(int,char * * const),int,char * * const)" (?init#framework#unit_test#boost##YAXP6APEAVtest_suite#23#HQEAPEAD#ZH0#Z)
1>BoostUnitTestFramework.lib(framework.obj) : error LNK2019: unresolved external symbol "void __cdecl boost::debug::detect_memory_leaks(bool)" (?detect_memory_leaks#debug#boost##YAX_N#Z) referenced in function "void __cdecl boost::unit_test::framework::init(class boost::unit_test::test_suite * (__cdecl*)(int,char * * const),int,char * * const)" (?init#framework#unit_test#boost##YAXP6APEAVtest_suite#23#HQEAPEAD#ZH0#Z)
1>BoostUnitTestFramework.lib(execution_monitor.obj) : error LNK2019: unresolved external symbol "bool __cdecl boost::debug::attach_debugger(bool)" (?attach_debugger#debug#boost##YA_N_N#Z) referenced in function "public: int __cdecl boost::detail::system_signal_exception::operator()(unsigned int,struct _EXCEPTION_POINTERS *)" (??Rsystem_signal_exception#detail#boost##QEAAHIPEAU_EXCEPTION_POINTERS###Z)
1>BoostUnitTestFramework.lib(execution_monitor.obj) : error LNK2019: unresolved external symbol "bool __cdecl boost::debug::under_debugger(void)" (?under_debugger#debug#boost##YA_NXZ) referenced in function "public: int __cdecl boost::execution_monitor::execute(class boost::unit_test::callback0<int> const &)" (?execute#execution_monitor#boost##QEAAHAEBV?$callback0#H#unit_test#2##Z)
1>BoostUnitTestFramework.lib(unit_test_main.obj) : error LNK2019: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite##YAPEAVtest_suite#unit_test#boost##HQEAPEAD#Z) referenced in function main
1>C:\Users\Rafid\Workspace\MyPhysics\Builds\VC10\Tests\Debug\Tests.exe : fatal error LNK1120: 6 unresolved externals
They seem to be mainly caused by Boost debug library, but I can't see a reason why I should get linking errors putting in mind that Boost debug library only need to be included as header files, rather than linking against as a library!
Any ideas?!
OK, I figured out what the problem is. Apparently, the list of files mentioned in Boost's website misses the following files:
debug.cpp
test_main.cpp
test_tools.cpp
Once I added those files to my project, the test project compiled and run successfully!
UPDATE: Just wanted to mention that I actually built against Boost 1.51, so it could be that the documentation is a bit old, because I can see that in the page, they are linking the files to Boost 1.35!
For compile unit-tests of boots 1.57 on windows,
I use #Rafid answer,
For me it was add this files to projects:
test_tools.cpp
unit_test_main.cpp
framework.cpp
That locate in BOOST_DIR/libs/test/src

VS2010 Unresolved External Symbol boost::asio::detail::winsock_init_base::throw_on_error when linking boost-system with a project using libtorrent

I'm trying to build a small command line BitTorrent client using Rasterbar's libtorrent, which depends on Boost. I've built both the Boost libraries and the libtorrent library using their respective directions, but when I try to build my project I get the following linking errors
1>------ Build started: Project: MiniBT, Configuration: Debug Win32 ------
1>MiniBT.obj : error LNK2019: unresolved external symbol "protected: static void __cdecl boost::asio::detail::winsock_init_base::throw_on_error(struct boost::asio::detail::winsock_init_base::data &)" (?throw_on_error#winsock_init_base#detail#asio#boost##KAXAAUdata#1234##Z) referenced in function "public: __thiscall boost::asio::detail::winsock_init<2,0>::winsock_init<2,0>(bool)" (??0?$winsock_init#$01$0A##detail#asio#boost##QAE#_N#Z)
1>MiniBT.obj : error LNK2019: unresolved external symbol "protected: static void __cdecl boost::asio::detail::winsock_init_base::startup(struct boost::asio::detail::winsock_init_base::data &,unsigned char,unsigned char)" (?startup#winsock_init_base#detail#asio#boost##KAXAAUdata#1234#EE#Z) referenced in function "public: __thiscall boost::asio::detail::winsock_init<2,0>::winsock_init<2,0>(bool)" (??0?$winsock_init#$01$0A##detail#asio#boost##QAE#_N#Z)
1>MiniBT.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::asio::error::get_misc_category(void)" (?get_misc_category#error#asio#boost##YAABVerror_category#system#3#XZ) referenced in function "void __cdecl boost::asio::error::`dynamic initializer for 'misc_category''(void)" (??__Emisc_category#error#asio#boost##YAXXZ)
1>MiniBT.obj : error LNK2019: unresolved external symbol "unsigned long __cdecl boost::asio::detail::win_tss_ptr_create(void)" (?win_tss_ptr_create#detail#asio#boost##YAKXZ) referenced in function "public: __thiscall boost::asio::detail::win_tss_ptr<class boost::asio::detail::call_stack<class boost::asio::detail::win_iocp_io_service,unsigned char>::context>::win_tss_ptr<class boost::asio::detail::call_stack<class boost::asio::detail::win_iocp_io_service,unsigned char>::context>(void)" (??0?$win_tss_ptr#Vcontext#?$call_stack#Vwin_iocp_io_service#detail#asio#boost##E#detail#asio#boost###detail#asio#boost##QAE#XZ)
1>MiniBT.obj : error LNK2019: unresolved external symbol "protected: static void __cdecl boost::asio::detail::winsock_init_base::cleanup(struct boost::asio::detail::winsock_init_base::data &)" (?cleanup#winsock_init_base#detail#asio#boost##KAXAAUdata#1234##Z) referenced in function "public: __thiscall boost::asio::detail::winsock_init<2,0>::~winsock_init<2,0>(void)" (??1?$winsock_init#$01$0A##detail#asio#boost##QAE#XZ)
It seems to indicate that the asio::detail namespace didn't get included in the boost-system library as it is only those 5 symbols that it seems to have a problem with and it is linking to the boost-system library just fine otherwise. I'm trying to build a 32-bit application on a 64-bit system, but everything I've checked seems to be correctly configured for this.
I know I'm missing something, but I can't seem to figure out what. Does anyone have any suggestions?
With BOOST_ASIO_SEPARATE_COMPILATION defined, in addition to #include "boost/asio/ssl/impl/src.hpp", you must also #include "boost/asio/impl/src.hpp" in one of your cpp files.

Resources