Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS 2017+vcpkg compiling update #1073

Open
Fenrisus opened this issue Mar 20, 2020 · 8 comments
Open

VS 2017+vcpkg compiling update #1073

Fenrisus opened this issue Mar 20, 2020 · 8 comments

Comments

@Fenrisus
Copy link

Hello there. It's kinda outdated right now.
If someone has issues with compiling at Visual Studio 2017 +vcpkg manager here the little things, that you should to fix.
Well, let's go.

Since version 1.1.0 OpenSSL have changed their library names from:
libeay32.dll -> libcrypto.dll
ssleay32.dll -> libssl.dll
settings.props file should looks like that:

..blahblahblah.
//find those 
    <OTCLIENT_LIBDEPS>
        glew32.lib;
        zlib.lib;
        libcrypto.lib; <----change libeay32.lib to libcrypto.lib
        physfs.lib;
        openal32.lib;
        lua51.lib;
        ogg.lib;
        vorbisfile.lib;
        vorbis.lib;
        opengl32.lib;
        dbghelp.lib;
        kernel32.lib;
        user32.lib;
        shell32.lib;
        gdi32.lib;
        advapi32.lib;
    </OTCLIENT_LIBDEPS>
    
    <OTCLIENT_LIBDEPS_D>
        glew32d.lib;
        zlibd.lib;
        libcrypto.lib; <----change libeay32.lib to libcrypto.lib
        physfs.lib;
        openal32.lib;
        lua51.lib;
        ogg.lib;
        vorbisfile.lib;
        vorbis.lib;
        opengl32.lib;
        dbghelp.lib;
        kernel32.lib;
        user32.lib;
        shell32.lib;
        gdi32.lib;
        advapi32.lib;
	</OTCLIENT_LIBDEPS_D>

Next statement is LUA;
around the code, instead of

#include "lua.h"
#include "lauxlib.h"
#include "lualib.h" 
#include <lua.hpp>

use luajit

#include "luajit/lua.h"
#include "luajit/lauxlib.h"
#include "luajit/lualib.h" 
#include <luajit/lua.hpp>

Done, it's compiles fine with Visual Studio 2017 and vcpkg.
Tested latest sources at 20/03/2020

@deviljin112
Copy link

deviljin112 commented Mar 20, 2020

You are god's sent. I've spent 4 hours trying to compile OTClient with fails everywhere, both on windows and linux... This was literally the entire issue in errors!

Although, where is the LUA part? what file as I cant find it anywhere in VS.

Edit: That solved it, found the files by just building and going to the line that the error said - Thank you!

@dev-rfc
Copy link

dev-rfc commented Mar 22, 2020

Thank you @Fenrisus, it worked with Visual Studio 2019 as well.

@pasturryx
Copy link

pasturryx commented Mar 26, 2020

where should i edit for the lua part? @renancavalieri @Fenrisus

@deviljin112
Copy link

@Felipe21 I confirm VS 2019 works too, i mean the easiest way is to compile then in errors it will point you to the file and you just change it there.

if you want to find the specific file. In VS 2019 open the otclient.sln and look for lbitlib.cpp and luainterface.cpp and I believe that's all

@pasturryx
Copy link

i'll check , thanks you @deviljin112

@pasturryx
Copy link

example i found this

libtlib.cpp
#define LUA_LIB

extern "C" {
#include <lua.h>
#include <lauxlib.h>
}

nothing like fenrisus posted
@deviljin112

@deviljin112
Copy link

Please use EDIT next time :) Not my repo but its a good practice to have :D

anyway, Fenrisus didnt post the entire file because its too big instead he summarised the lines you need to change. So just change what he stated into what it should be regardless of how the file is built. Find it => Replace it. Simple as that.

@carlesonielfa
Copy link

@TheSumm Writing here because this seems to be the current open issue on the topic, and tagging you because you implemented the lastest fix on vcpkg compiling.

To build with the sources as of 28/12/2023, apart from installing the libraries mentioned in the tutorial (https://github.com/edubart/otclient/wiki/Compiling-on-Windows#microsoft-visual-studio-2017-with-vcpkg) and doing the changes in the Lua libraries that @Fenrisus explained, I also had to install boost-thread and openssl with vcpkg.

With that I was able to build using Visual Studio 2022 (v143)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants