Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. Contact Sales if your project requires a support plan.

Link error on CommunicationCentral.lib, Where are the Network and GameSocket classes?

+1 vote
I'm following the help file and the integration example to integrate the Wwise SDK within my custom engine. Everything was working ok until I reached the part where you do that

    // Initialize communications (not in release build!)
    if (AK::Comm::Init(commSettings) != AK_Success)
        assert(!"Could not initialize communication.");
        return false;
#endif // AK_OPTIMIZED


All I'm obtaining are those linker errors related to Network and GameSocket


Error    2    error LNK2019: unresolved external symbol __imp_htons referenced in function "bool __cdecl Network::SameEndianAsNetwork(void)" (?SameEndianAsNetwork@Network@@YA_NXZ)    engine\CommunicationCentral.lib(Network.obj)    engine

Error    3    error LNK2001: unresolved external symbol __imp_htons    engine\CommunicationCentral.lib(GameSocketAddr.obj)    engine

Error    7    error LNK2019: unresolved external symbol __imp_accept referenced in function "public: void __cdecl GameSocket::Accept(class GameSocketAddr &,class GameSocket &)" (?Accept@GameSocket@@QEAAXAEAVGameSocketAddr@@AEAV1@@Z)    engine\CommunicationCentral.lib(GameSocket.obj)    engine

Error    8    error LNK2019: unresolved external symbol __imp_bind referenced in function "public: long __cdecl GameSocket::Bind(class GameSocketAddr const &)" (?Bind@GameSocket@@QEAAJAEBVGameSocketAddr@@@Z)    engine\CommunicationCentral.lib(GameSocket.obj)    engine

[omited errors due 8000 character limitation of the forum]


I'm comparing the IntegrationDemo with my project and don't see anything wrong. Also I have open the CommunicationCentral.lib triying to find any clue, but no luck. All I see is that


long __cdecl Network::GetLastError(void);
void __cdecl Network::GetMachineName(char * __ptr64,long * __ptr64);
enum AKRESULT __cdecl Network::Init(long,bool);
bool __cdecl Network::SameEndianAsNetwork(void);
void __cdecl Network::Term(bool);

public: __cdecl GameSocketAddr::GameSocketAddr(class GameSocketAddr const & __ptr64) __ptr64;
public: __cdecl GameSocketAddr::GameSocketAddr(unsigned long,unsigned short) __ptr64;
public: __cdecl GameSocketAddr::GameSocketAddr(void) __ptr64;
public: __cdecl GameSocketAddr::~GameSocketAddr(void) __ptr64;
public: static unsigned long __cdecl GameSocketAddr::ConvertIP(char const * __ptr64);
public: unsigned long __cdecl GameSocketAddr::GetIP(void)const __ptr64;
public: struct sockaddr_in & __ptr64 __cdecl GameSocketAddr::GetInternalType(void) __ptr64;
public: struct sockaddr_in const & __ptr64 __cdecl GameSocketAddr::GetInternalType(void)const __ptr64;
public: unsigned short __cdecl GameSocketAddr::GetPort(void)const __ptr64;
public: void __cdecl GameSocketAddr::SetIP(unsigned long) __ptr64;
public: void __cdecl GameSocketAddr::SetPortW(unsigned short) __ptr64;
public: __cdecl GameSocket::GameSocket(void) __ptr64;
public: __cdecl GameSocket::~GameSocket(void) __ptr64;
public: void __cdecl GameSocket::Accept(class GameSocketAddr & __ptr64,class GameSocket & __ptr64) __ptr64;
public: long __cdecl GameSocket::Bind(class GameSocketAddr const & __ptr64) __ptr64;
public: long __cdecl GameSocket::Close(void) __ptr64;
public: long __cdecl GameSocket::Connect(class GameSocketAddr const & __ptr64) __ptr64;
public: bool __cdecl GameSocket::Create(long,long,bool) __ptr64;
public: unsigned short __cdecl GameSocket::GetPort(void)const __ptr64;
public: bool __cdecl GameSocket::IsValid(void)const __ptr64;
public: long __cdecl GameSocket::Listen(long)const __ptr64;
public: void __cdecl GameSocket::NoDelay(void) __ptr64;
public: long __cdecl GameSocket::Poll(enum GameSocket::PollType,unsigned long)const __ptr64;
public: long __cdecl GameSocket::Recv(void * __ptr64,long,long)const __ptr64;
public: long __cdecl GameSocket::RecvFrom(void * __ptr64,long,long,class GameSocketAddr & __ptr64)const __ptr64;
public: void __cdecl GameSocket::ReuseAddress(void) __ptr64;
public: long __cdecl GameSocket::Send(void const * __ptr64,long,long)const __ptr64;
public: long __cdecl GameSocket::SendTo(void const * __ptr64,long,long,class GameSocketAddr const & __ptr64)const __ptr64;
public: long __cdecl GameSocket::Shutdown(long)const __ptr64;


but no clue where all this come from.

So, I have no idea which .lib, .h or .cpp I'm missing. I REALLY need help with that. Any help will be appreciated.



Due some problems I'm finding now, I think the problem comes from the calling convention. Apparently the libraries are compiled with __cdecl and my engine works with __vectorcall. It gave me problems in the past, could be the reason. Only way to know is recompile the library with my calling convention, but, is It possible? Can I have the code for generate the CommunicationCentral.lib?
asked Jul 15, 2015 in General Discussion by M.Bruno R. (300 points)
edited Jul 17, 2015 by M.Bruno R.
I am having the same issue, however, mine doesn't seem to be related to how my engine works. Any help in this matter I would appreciate.

1 Answer

0 votes

For those of you coming from google looking for a solution to this problem, you need to make sure to include ws2_32.lib, for both 32 and 64 bit (the .lib name is the same for both platforms)

answered Mar 11 by Rafael S. (220 points)