keywords: C++, std_Binderstd_Unforced, sockaddr, int __cdecl invoke_main(void)

unresolved external symbol main referenced in function “int __cdecl invoke_main(void)”

Error:

MSVCRTD.lib(exe_main.obj): Error LNK2019 : unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)

Solution:
Add /subsystem:windows:

#ifdef _WIN32
#pragma comment(linker, "/subsystem:windows")
#include <windows.h>
#endif
cannot convert from ‘std::_Binder’

Error:

Error C2440 : 'initializing': cannot convert from 'std::_Binder<std::_Unforced,int &,sockaddr *,size_t>' to 'int'

Solution:
Give a global function symbol.

int rs = ::bind(ServerSocket, (sockaddr*)&oAddr, sizeof(oAddr));

“Trying to predict the future is like trying to drive down a country road at night with no lights while looking out the back window. ” ― Peter Drucker