![]() |
LoadLibrary failure for Linux
I recently was able to get my bot compiling under Linux. However, when I try to use the bot, HLDS reports this:
Quote:
[EDIT] Some additional information. I'm compiling under Fedora Core 3 using GCC 3.4 with it's C++ libraries. Googling "__cxa_guard_acquire" gave me some pages talking about how GCC uses it in linking to make things "thread-safe". I'm not experienced enough with GCC to understand what all of this means exactly. I'm guessing there is perhaps a parmeter I can set in the makefile to disable using __cxa_guard_acquire, but I'm not sure what it'd be... If someone with a Linux box would volunteer to compile what I have and see if it is a problem with my Fedora Core 3 box (Googling hints at this) or my source, that'd be nice. Any takers? E-mail me, ghoul at nocensmundus dot net. |
Re: LoadLibrary failure for Linux
Quote:
|
Re: LoadLibrary failure for Linux
"I'm guessing there is perhaps a parmeter I can set in the makefile to disable using __cxa_guard_acquire, but I'm not sure what it'd be..."
If you have "-thread" in the Makefile, try removing it. If you don't have "-thread" try adding it on the gcc line. :) botman |
Re: LoadLibrary failure for Linux
GCC complains that it is an unrecognized option. I'm not sure exactly where I'd add it, I tried the various flag lines of the makefile. My makefile currently looks like this (based on HPB Bot 4):
http://www.nocensmundus.net/gb_linux_makefile.txt |
Re: LoadLibrary failure for Linux
Change the "gcc" to "g++" will probably solve your problem. gcc is the C compiler while the "g++" is the C++ compiler.
You may also want to add a "-static" parameter in the link command to make the .so file runs under any GNU/Linux systems. |
Re: LoadLibrary failure for Linux
Hey thanks, I got it working. (though I'm not sure where to add that -static flag).
Using the normal hooking method, the bot runs great. Now comes getting it to run in metamod. I can get the metamod version to compile, but metamod reports the file is bad when I do "metamod list". I compared the Grave Bot metamod .so to the HPB Bot 4 metamod .so, and HPB Bot is nearly twice as big. That seems strange, because I know HPB Bot doesn't have that much more code. It has the extra model and chatting code, but I don't see how that'd double the size compared to my .so. [EDIT] Actually, I just compiled HPB bot 4 and it's the same size, which is about half the size of the .so downloaded off the website. What is going on? [EDIT TWO] It still works though. Does this have something to do with -static? I think something isn't getting properly compiled into the metamod .so, but I'm not sure what. I'm not too experienced with metamod. Any ideas? |
Re: LoadLibrary failure for Linux
debug builds in Linux have VERY much extra info embedded in the binaries. And given several parameters (compiler version, libC version, external libs etc.) the exact same source code compiled on 2 Linux machines will not necessarily give the same size (and size can differ greatly). There's a command-line tool to strip the debug symbols from your binaries, called "strip" if I remember well.
*edit* also check if your machine is set up for Unicode or not. |
Re: LoadLibrary failure for Linux
change this one:
PHP Code:
PHP Code:
|
Re: LoadLibrary failure for Linux
Well, that did make the file size less. The MM .so is 30 KB smaller, and the normal .so is around 80 KB smaller.
However, metamod still refuses to load the file. I'm completely baffled. Perhaps a linux specific section for metamod was missed when porting the code? Hmmm... |
Re: LoadLibrary failure for Linux
I'm sure the MM problem is because of your source code. Probably something is missing or wrong.
Does it work on Windows ? |
Re: LoadLibrary failure for Linux
Yeah, it works like a charm, thanks to PM.
I have no clue where to look though. The metamod site doesn't give any details on why a file might be considered bad. |
Re: LoadLibrary failure for Linux
Given the implementation of my plugin "template", and provided you don't have any Windows-specific code in your bot, the 3 functions you need to check are Meta_Query, Meta_Attach and Meta_Detach. Perhaps there's something wrong with the C_DLLEXPORT definition (lack of #ifdef __linux or something)
|
Re: LoadLibrary failure for Linux
there is a "stub_plugin" in the metamod source code, you may take a look at it. It's basically a minimal version of plugin which doesn't have anything but just make it load in Metamod.
|
Re: LoadLibrary failure for Linux
I wouldn't advise that. The "stub plugin" is bloated and outdated.
|
Re: LoadLibrary failure for Linux
Problem solved.
|
Re: LoadLibrary failure for Linux
may I ask what was the problem ?
|
Re: LoadLibrary failure for Linux
Metamod wasn't looking in the right directory :P
Oh, and you can update the forum display to show Grave Bot supports Linux. |
Re: LoadLibrary failure for Linux
okie dokie, and congrats ;)
|
All times are GMT +2. The time now is 20:43. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.