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

[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 , 09: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 09:58.
Ghosted is online now
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-29-2018 , 10: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 10:41.
KliPPy is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-29-2018 , 11: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 11:13.
Ghosted is online now
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-29-2018 , 11: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 11:28.
KliPPy is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-29-2018 , 13: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 13:33.
Ghosted is online now
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-29-2018 , 16: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 , 17: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, 40 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 17:25.
Ghosted is online now
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-31-2018 , 08: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 10: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 07:26.


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