CmdJohnson 10 Posted June 13, 2014 Hello everyone, I recently gained interest in developing an extension for my arma 3 linux server. I went to the wiki (-> Extensions#Linux_shared_library_interface (first post, so no links)), compiled the example, put the resulting example.so in my server root directory and called it via diag_log ["Output: %1", "example" callExtension "version"]; from within my init.sqf file. However, I get no output (besides "Output: ", what is definately not the output I want). So, the three possible Errors that come into my mind are: the C code is broken I'm calling the extension the wrong way I placed the file at the wrong location I already tried to modify the code to always return "It works!" whenever I call it, and I tested the whole extension by writing a small program, that loads it and calls the function; in that case, I got the desired output, so I guess the extension itself is okay. I'm realy stuck on this, so any clues are appreciated. Share this post Link to post Share on other sites
albertfish 11 Posted June 13, 2014 Where did you put the extension that you are trying to call? Also, have you tried writing to a file or something to see if the extension code is executing? Share this post Link to post Share on other sites
CmdJohnson 10 Posted June 14, 2014 I put that thing into my arma 3 server root directory, at the same level as the main executable, but I also tried putting it in a subfolder and adding that folder as a mod (the .so in the ./@example folder, with parameter -mod="@example"). Writing to a file, again, works completely fine with my test program, but called from within the sqf script just does nothing at all. Share this post Link to post Share on other sites
CmdJohnson 10 Posted June 18, 2014 Anyone? I'd love to contine my work on this topic :/ Share this post Link to post Share on other sites
Master85 1 Posted June 18, 2014 when on a 64-bit linux make sure to compile it as 32-bit gets the shared library loaded by the server? (check with lsof, strace, ...) Share this post Link to post Share on other sites
CmdJohnson 10 Posted June 18, 2014 Well.. thanks Turned out I really compiled it as a 64bit library, I should've thought of that Compiling it with the -m32 flag did the magic for me, now everything works just fine! Share this post Link to post Share on other sites
Ra'Jiska 19 Posted July 15, 2015 Hey, sorry for necroing this thread but cannot create any new one. Is there any way to compile C++ code into Shared Object for Arma ? I've been compiling it with gcc & g++ many times, but only the C code is working (otherwise extension isn't loaded). Here are the commands I used: gcc -shared -fPIC -m32 -o example.so example.c gcc -shared -fPIC -m32 -o example.so example.cpp g++ -shared -fPIC -m32 -o example.so example.c gcc -shared -fPIC -m32 -o example.so example.cpp Thanks. Share this post Link to post Share on other sites