Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

+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

**************************************************************************************************
#ifndef AK_OPTIMIZED
    //
    // Initialize communications (not in release build!)
    //
    AK::Comm::GetDefaultInitSettings(commSettings);
    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.

Thanks.

 

UPDATE 1:
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?
in General Discussion by M.Bruno R. (300 points)
edited 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

+2 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)

by Rafael S. (260 points)
...