AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question about the compilation from cvs (https://forums.alliedmods.net/showthread.php?t=462)

XAD 03-27-2004 10:09

Quote:

Originally Posted by NiLuJe
... the original amx 0.9.6j compile well with gcc 3.3.3, (no compilation error) but the binaries is a lot smaller (default optimisation)

How did you get it to compile with GCC 3.3.3? Did you use the default AMXmodX' Makefile or did you change any options??

When I compile with GCC 3.2.3 I get following compile error:
Code:

CModule.h: At global scope:
CModule.h:76: template-argument `AMX_NATIVE_INFO*' uses anonymous type
CModule.h:76: ISO C++ forbids declaration of `natives' with no type

Is this a problem only with GCC 3.2.3 or a compiler option fix??

/X

PS! To AMXmod 0.9.6j to run with "athlon-xp" I added "-lstdc++" to the link options...

PM 03-27-2004 10:33

It looks like GCC 3.3 (i have 3.3.1) doesn't like the __attribute(packed) thing. To compile, try changing
#ifdef __GCC__
#define PACKED something
...

to
#ifdef __GCC__
#define PACKED

in amx.h

It compiles, but i am not sure whether it affects something else. I'll try to find an another way of doing it.

XAD 03-27-2004 17:23

Quote:

Originally Posted by PM
It looks like GCC 3.3 (i have 3.3.1) doesn't like the __attribute(packed) thing. To compile, try changing
#ifdef __GCC__
#define PACKED something
...

Yepp... it compiled (but it was called "__GNUC__")...

To bad you guys started with AMXmod 0.9.6j and not my "fixed" version as I changed the original code to fix all warnings (except the two in the amx engine)...

Thanks... I will test it to see if it broke something ;-)
/X

BAILOPAN 03-27-2004 17:33

Where is your fixed version? ;]

XAD 03-27-2004 17:57

Quote:

Originally Posted by BAILOPAN
Where is your fixed version? ;]

On my machine... :wink:

I didn't mean I expected you to have used it, only that it was bad as I think compile warnings indicates some possible issues with the code and therefore should be recoded (even if it's causing any problems).

I suppose this is the same reason I "hate" people saying that plugin compile indentation warnings should be ignored as to me it indicates that the coder have created code that is error prone and easy to read wrong (also for the coder him/herself)... but hey, it's my personally opinion (and only a problem for you if I'm your boss :wink:).

/X

PS! It's no magic or complicated only a fix of what the warnings suggest...

BAILOPAN 03-27-2004 18:03

Could you send it to me? I have tried reducing a great many of the warnings but some I could not fix (such as ones about Vector casts)

NiLuJe 03-28-2004 05:15

Xad : No, used the defaut makefile of amx 0.9.6j for my "test compile" with gcc 3.3.3 (amx 0.9.7 from the CVS at AMXMOD project on sourceforge)

PM: I'll try that ;)
EDIT: Doesn't work, it compiles, but the file is small (~ 190Ko ) and got a nice
Code:

[META] ERROR: dll: Failed query plugin '<amxx_mm_i686.so>'; Couldn't open file '/home/niluje/HLDS_L/cstrike/addons/amxx/dlls/amxx_mm_i686.so': /home/niluje/HLDS_L/cstrike/addons/amxx/dlls/amxx_mm_i686.so: undefined symbol: __gxx_personality_v0
:/

I would also like to know how to make my compile compatible with the glibc 2.2 system (because mine is under 2.3)? I saw in the metamod makefile this line
Code:

        # link against older libc for compatibility
        EXTRA_LINK = -L../priv/libc -lc

So it may be possible, but how can i install the old libc without screwing up my system?

PM 03-28-2004 07:42

NiLuJe: Try compiling everything with gcc 3.3;
Update: it looks like the PACKED attribute should only be removed after the names, that is, things like

typedef struct
{
a PACKED;
b PACKED;
} mytype /* no PACKED */;

NiLuJe 03-28-2004 08:07

PM : Okay 'ill try ;)

Metamodx : OK, works fine :) (after changing the -malign-xx flags to -faling-xx, like the warning said :) )

Amxmodx: Hu, what should i do with the packed thing? Edit by hand the amx.h to remove every packet after the names? (will try that ^^ ) : Done it and it WORKS ;) And the binarie is A LOT smaller! (also changed the -malign)

csstats: Works (-malign too)

fun: Works (-malign)

csstrike: Works (-malign)

engine: Works (-malign) binarie A LOT smaller too (/2 !)

mysql: Not tested but should works too ;)

EDIT: If you want to test, i uploaded all the compiles i made today :
http://n1luj3.free.fr/compil_test.tar.gz (5,4mo lot of compile ^^)

BAILOPAN 03-28-2004 11:13

If gcc-3.3 binaries are stable for you I will distribute 686 binaries compiled by gcc-3.3 from now on


All times are GMT -4. The time now is 21:50.

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