• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTCv8 fix Compile errors

Perun

nems.online
Joined
May 1, 2009
Messages
378
Solutions
7
Reaction score
176
Hi, if any of you have problems with compiling otcv8 using new packages (boost 1.80 etc) there is simple solution.
If you have installed all required packages using vcpkg just open src/framework/net/connection.cpp
and change:

Connection::read_some
C++:
asio::async_read(m_socket,
                     asio::buffer(m_inputStream.prepare(bytes)),
                     std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2));
to
C++:
asio::async_read(m_socket,
        m_inputStream.prepare(bytes),
        std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2));

and

Connection::read
C++:
asio::async_read(m_socket,
                     asio::buffer(m_inputStream.prepare(bytes)),
                     std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2));
to
C++:
asio::async_read(m_socket,
        m_inputStream.prepare(bytes),
        std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2));

and everything should be ok.
If you still have some problems with packages, just right click on your project in visual studio editor, click on 'vcpkg', change 'Use Vcpkg Manifest' to true and create file 'vcpkg.json' + add this file to your visual studio otc project, inside put
JSON:
{
  "name": "otclient",
  "version-string": "1.0.0",
  "dependencies": [
    "boost-asio",
    "boost-system",
    "boost-beast",
    "boost-uuid",
    "boost-process",
    "boost-iostreams",
    "boost-variant",
    "boost-lockfree",
    "boost-process",
    "boost-program-options",
    "boost-filesystem",
    "opengl",
    "libogg",
    "libvorbis",
    "nlohmann-json",
    "openal-soft",
    "openssl",
    "physfs",
    "protobuf",
    "zlib",
    "liblzma",
    "libzip",
    "parallel-hashmap",
    "stduuid",
    "luajit",
    {
      "name": "glew",
      "platform": "windows"
    }
  ]
}
Then open your powershell with admin permissions and type
Code:
[System.Environment]::SetEnvironmentVariable('VCPKG_ROOT','C:\vcpkg', [System.EnvironmentVariableTarget]::Machine)
just remember to set c:\vcpkg with your vcpkg folder, after that you should be able to compile no problems
 
Back
Top