ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.71k stars 626 forks source link

Ricochet mp.so not compiling #2099

Closed tyabus closed 5 years ago

tyabus commented 5 years ago

Error messages:

client.cpp: In function ‘int GetHueFromRGB(float, float, float)’:
client.cpp:70:20: error: ‘max’ was not declared in this scope
  float fMax = max( max( r, g ) , b );
                    ^~~
client.cpp:70:20: note: suggested alternative: ‘fmax’
  float fMax = max( max( r, g ) , b );
                    ^~~
                    fmax
client.cpp:70:15: error: ‘max’ was not declared in this scope
  float fMax = max( max( r, g ) , b );
               ^~~
client.cpp:70:15: note: suggested alternative: ‘fmax’
  float fMax = max( max( r, g ) , b );
               ^~~
               fmax
client.cpp:71:20: error: ‘min’ was not declared in this scope
  float fMin = min( min( r, g ) , b );
                    ^~~
client.cpp:71:20: note: suggested alternative: ‘sin’
  float fMin = min( min( r, g ) , b );
                    ^~~
                    sin
client.cpp:71:15: error: ‘min’ was not declared in this scope
  float fMin = min( min( r, g ) , b );
               ^~~
client.cpp:71:15: note: suggested alternative: ‘sin’
  float fMin = min( min( r, g ) , b );
               ^~~
               sin
client.cpp: In function ‘int GetWeaponData(edict_s*, weapon_data_s*)’:
client.cpp:1548:35: error: ‘max’ was not declared in this scope
       item->m_flTimeWeaponIdle  = max( gun->m_flTimeWeaponIdle, -0.001 );
                                   ^~~
client.cpp:1548:35: note: suggested alternative: ‘fmax’
       item->m_flTimeWeaponIdle  = max( gun->m_flTimeWeaponIdle, -0.001 );
                                   ^~~
                                   fmax

GCC version: 7.4.0 OS: Ubuntu 16.04

JoelTroch commented 5 years ago

Option A) Change the calls as suggested in the log.

Option B) Rename Valve's macros and refactor the calls to use them.

Option C) Downgrade GCC/G++.

Option A being the best one.

tyabus commented 5 years ago

Well, i downgraded to g++/gcc 6.5.0, problem dosen't show up on this version.