I am trying to build this Late Downloads extension for TF2 and L4D2. While someone has kindly compiled the binaries for me, I would still like to be able to compile it myself so I can edit it later.
When I run configure.py from the latedl/build folder, the script returns this information:
l4d2@ns531866:~/metamod/latedl/build$ python ../configure.py --hl2sdk-root=/home/l4d2/metamod --mms-path=/home/l4d2/metamod/metamod-source --sm-path=/home/l4d2/metamod/sourcemod --sdks=l4d2,tf2
Checking CC compiler (vendor test gcc)... ['cc', 'test.c', '-o', 'test']
found gcc version 7.5
Checking CXX compiler (vendor test gcc)... ['c++', 'test.cpp', '-o', 'testp']
found gcc version 7.5
However, when I try to compile the code using ambuild, I get an error. The same error occurs when I use GCC 10.3.
In file included from /home/l4d2/metamod/hl2sdk-l4d2/public/tier1/utlvector.h:23:0,
/home/l4d2/metamod/hl2sdk-l4d2/public/tier1/utlmemory.h: In member function ‘void CUtlMemory<T, I>::Swap(CUtlMemory<T, I>&)’:
/home/l4d2/metamod/hl2sdk-l4d2/public/tier1/utlmemory.h:330:2: error: there are no arguments to ‘V_swap’ that depend on a template parameter, so a declaration of ‘V_swap’ must be available [-fpermissive]
V_swap( m_nGrowSize, mem.m_nGrowSize );
/home/l4d2/metamod/hl2sdk-l4d2/public/tier1/utlmemory.h:330:2: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/l4d2/metamod/hl2sdk-l4d2/public/tier1/utlmemory.h:332:2: error: there are no arguments to ‘V_swap’ that depend on a template parameter, so a declaration of ‘V_swap’ must be available [-fpermissive]
V_swap( m_nAllocationCount, mem.m_nAllocationCount );
Zynda suggested that Clang would work better for compiling Sourcemod extensions and supports this extension out of the gate.
From what I've been able to gather, if my system has Clang installed (it does, version 6.0.0-1ubuntu2), AMBuild should be trying to use that first. However, I don't see that.
How do I tell AMBuild to compile the extension with Clang? Is there something I need to edit in the build script, or an environment variable I need to change?
Alternatively, what should I try changing in my environment to get GCC to compile the project properly?