alliedmodders / metamod-source

Metamod:Source - C++ Plugin Environment and Detour Library for the Source Engine
http://www.metamodsource.net/
Other
383 stars 87 forks source link

Using static library #165

Closed DiDHack closed 8 months ago

DiDHack commented 8 months ago

Hello! Earler I used the static library of redis-plus-plus in the plugin: postlink:

os.path.join(builder.sourcePath, 'redis', 'lib', 'libredis++.a'),
os.path.join(builder.sourcePath, 'redis', 'lib', 'libhiredis.a'),

In the code:

#include <sw/redis++/redis++.h>

using namespace sw::redis;

std::unique_ptr<Redis> redis;

In the statup function:

redis = std::make_unique<Redis>(std::string("tcp://") + redis_settings["ip"] + ":" + redis_settings["port"] + "/" + redis_settings["db"]);
.....

It worked fine. But after yesterday's update it is compiled but I get the error when I load my plugin: undefined symbol: _ZN2sw5redis5reply5parseENS1_8ParseTagISsEER10redisReply

I don't understand what I need to resolve it

DiDHack commented 8 months ago

I have tried to use the shared library:

ldd ./plugin.so
        linux-vdso.so.1 (0x00007fff139ca000)
        libtier0.so => not found
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc9ad2c5000)
        libredis++.so.1 => /usr/local/lib/libredis++.so.1 (0x00007fc9ad233000)
        libhiredis.so.1.2.1-dev => /usr/local/lib/libhiredis.so.1.2.1-dev (0x00007fc9ad21d000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc9ad048000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc9ad6f0000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc9acf04000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc9acee8000)

But I get: libredis++.so.1: cannot open shared object file: No such file or directory

peace-maker commented 8 months ago

This issue tracker is about problems with metamod source itself. Please join the Alliedmodders Discord server or post on the forums with general questions.