I've compiled tgstation's implementation of an interface to boost::regex on a debian system, but I cannot get Byond to see the library, no matter where I place the .so file.

Detailed info -
repository for interface:

Compilation steps for library
g++ -c -m32 -Wall -lstdc++ -lboost_regex -fPIC -o bygex.o main.cpp
g++ bygex.o -m32 -shared -o

I tested this by compiling client.cpp ( a test file )
g++ client.cpp -m32 -lstdc++ -lboost_regex -L. -lbygex
Outputted a.out file executed cleanly as I would expect

file correctly reports an elf32 binary, so the compilation steps seem fine
user@machine:~/byond-regex$ file ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=4ab0775c871dc249cfade278951088551fc9e348, not stripped

The calling code uses a define, which I have set as

and the calls look similar too
call(LIBREGEX_LIBRARY, "regEx_compare")

However, when I place the in /usr/local/byond/bin and run DD with the following command it runtimes with an error about being unable to call it.

DreamDaemon tgstation.dmb 45000 -trusted -logself

Then in the log file
runtime error: Unable to load library
proc name: replacetext (/proc/replacetext)

My first thought was to create a softlink to from based on earlier threads I saw here about how byond loads .so's, but this approach had no luck, I then also tried to put the library in a local bin and set + export LD_LIBRARY_PATH, however this also met with zero success.

Is anyone able to shed any light on what the heck I'm doing wrong here?

You can grab the .so from here if it will help
I've tried some new and exciting variations on the theme

+ #define LIBREGEX_LIBRARY "/home/user/tgstation/bin/"

Ensured file was in place at that address

Still no luck, same error in logs
runtime error: Unable to load library /home/user/tgstation/bin/
proc name: replacetext (/proc/replacetext)

Place it alongside the DMB in question, and set


Alternatively, place it within /usr/lib or such so it's on the ldpath.
Tried your first suggestion, unfortunately no dice and the error remains the same

runtime error: Unable to load library

I'll try the /usr/lib steps next

Thanks for the help
Ah, I wonder if it's owing to the fact you've dynamically linked boost_regex into it? Although I'd have thought that if boost_regex was installed as a 32 bit so for your compilation, it would be on the ldpath and resolve okay anyway.
This is getting a little bit weird now


then stracing DreamDaemon

strace DreamDaemon tgstation.dmb 45000 -trusted -logself 2>&1 | grep '^open(".*\.so"'

Shows it finds the shared lib
open("/home/user/tgstation/", O_RDONLY|O_CLOEXEC) = 4

However the log still contains bygex runtime errors!
user@machine:~/tgstation$ grep 'bygex' tgstation.log
runtime error: Unable to load library
source file:,55
runtime error: Unable to load library
source file:,55

Does anyone have any thoughts?

I'll check to see if boost's 32 bit libraries are on the ldpath as well
Well I figured it out, and its a bit of facepalm

I forgot to link boost_regex in when actually generating the .so

Thanks for your help, even though I was running down the wrong path Stephen001

For reference, correct invocation is
g++ bygex.o -m32 -lstdc++ -lboost_regex -shared -o
Hey Optimumtact, i have a question for you, im trying to host on tg too, and i dont know where do i find this to move, can you help me with it?

EDIT: nevermind, i found it

in case anyone else is looking.

It's been superseded as of 510 by the built in regex anyway.