Raised This Month: $12 Target: $400
 3% 

[HELP] Compiling for linux


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-29-2018 , 08:57   [HELP] Compiling for linux
Reply With Quote #1

What is best way of compiling on linux?



What is best version of gcc for building amxx module as shared object (.so) ?


Does anyone has files provided on metamod site for compiling on cygwin?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 10-29-2018 at 08:58.
Ghosted is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-29-2018 , 09:41   Re: [HELP] Compiling for linux
Reply With Quote #2

Use whatever compiler version or build system that you want (don't use an ancient one of course). However the kind-of-official-way for amxx is to use AMBuild.
__________________

Last edited by klippy; 10-29-2018 at 09:41.
klippy is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-29-2018 , 10:12   Re: [HELP] Compiling for linux
Reply With Quote #3

I used gcc (g++) of ubuntu 16 (I think version was 6.20) but couldnt run it. It was requiring CXXABI_1.3.8. Other AMXX Modules were OK.

Compiling from cygwin caused Invalid ELF Header error
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 10-29-2018 at 10:13.
Ghosted is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-29-2018 , 10:27   Re: [HELP] Compiling for linux
Reply With Quote #4

Are you compiling a public module or writing one yourself? Are you using any standard library features like STL or anything from the std:: namespace? What symbols exactly did the linker say were missing?
__________________

Last edited by klippy; 10-29-2018 at 10:28.
klippy is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-29-2018 , 12:23   Re: [HELP] Compiling for linux
Reply With Quote #5

Quote:
Originally Posted by KliPPy View Post
Are you compiling a public module or writing one yourself? Are you using any standard library features like STL or anything from the std:: namespace? What symbols exactly did the linker say were missing?
Public Module.
I'm not using std namespace items.
Linker was OK.

( Additional Info: Im Using following includes:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>

#include <sys/mman.h>
#include <unistd.h>
#include <limits.h>
)

I'll Try AMBuild
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 10-29-2018 at 12:33.
Ghosted is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-29-2018 , 15:04   Re: [HELP] Compiling for linux
Reply With Quote #6

Wait; if you compile another module and run it - it works, but when you compile that one it requires CXXABI_1.3.8?
If it's a public released module can you post it?
__________________
klippy is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-29-2018 , 16:23   Re: [HELP] Compiling for linux
Reply With Quote #7

Quote:
Originally Posted by KliPPy View Post
Wait; if you compile another module and run it - it works, but when you compile that one it requires CXXABI_1.3.8?
If it's a public released module can you post it?
I didnt compile other modules only this one. Wanted to try old version of gcc (g++) by running lower version of ubuntu but they throw errors like it was compiled in C and not in C++.
Heres module: (Makefile contains command line which i executed via terminal)
Attached Files
File Type: zip CSWM.zip (145.2 KB, 112 views)
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 10-29-2018 at 16:25.
Ghosted is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-31-2018 , 07:35   Re: [HELP] Compiling for linux
Reply With Quote #8

Do you get the missing CXXABI_1.3.8 error when you run it on some hosted server or on the same machine you compiled the module on? Hosting services are known to keep running old versions, I've had issues with this a couple of years back when I compiled a module.

Try linking stdc++ statically. Search around how to do it, but probably -static-libstdc++ is enough. Try linking everything statically with -static as well. I don't know if there are any gotchas with that though that might screw you over later.

EDIT:
Actually there's a high probability that the main issue is that Valve ships their own libstdc++.so.6 with HL which only contains ABI up to CXXABI_1.3.3, which I think matches like GCC 4.7 or 4.8, because the last they updated it was in the 2013 Steam Pipe update. I believe that AMXX and modules don't even link to the standard library (or avoid it as much as possible) by disabling many C++ standard features, like exceptions, rtti etc. Look at AMBuildScript from amxmodx to see what exactly it does. I know you can add -fno-exceptions and -fno-rtti and that's what I've always used as well.

EDIT2:
Code:
strings -a libstdc++.so.6 | grep GCC:
reveals that it was compiled with GCC 4.6.1.

EDIT3:
Here's my usual setup that I've had no issues with: https://github.com/rsKliPPy/customen...Script#L66-L89
__________________

Last edited by klippy; 10-31-2018 at 09:04.
klippy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode