ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.73k stars 1.99k forks source link

Undefined reference to Pow_FixedPoint_Exponent_SIMD on linux #415

Closed joedight closed 6 years ago

joedight commented 7 years ago

When I try to compile on linux (debian unstable), with make -f everything.mak, the make fails for both client_hl2 and client_episodic with a load of undefined references to the same function: (starting) ../../lib/public/linux32/particles.a(builtin_initializers.o): In function 'C_INIT_CreateWithinSphere::InitNewParticlesBlock(CParticleCollection*, int, int, int, void*) const': /home/johns/valve/ValveGames/rel/singleplayer/src/particles/builtin_initializers.cpp:559: undefined reference to 'Pow_FixedPoint_Exponent_SIMD(float __vector const&, int)' (then for) CParticleOperatorInstance::InitScalarAttributeRandomRangeExpBlock and a few others, before finally failing with everything.mak:23: recipe for target 'all' failed make: *** [all] Error 2 I'm using the steam runtime as described at https://developer.valvesoftware.com/wiki/Source_SDK_2013, but with updated g++ and ld, given the included ones don't seem to work. I'm sure I'm doing something stupid, but if it were that trivial I'd have thought that someone else must have asked it. Thanks.

Ristovski commented 7 years ago

Can confirm, any news?

Nephyrin commented 7 years ago

As the SDK contains pre-compiled static libraries such as particles.a, building and linking code with newer toolchains that have differing ABIs will fail. I would suspect that the signature of Pow_FixedPoint_Exponent_SIMD in particles.a is not what your newer compiler is generating when you build mathlib.

The solution would be to use the toolchain in the steam runtime (based upon GCC 4.6), or an ABI-compatible one.

Ristovski commented 7 years ago

@Nephyrin Isn't the source for said pre-compiled static libs present as well? How would one compile those?

Nephyrin commented 7 years ago

The source for libraries such as particles.a are not present in the SDK

TacoDeBoss commented 7 years ago

Coming across this problem myself, and I'm having a hell of a time trying to get the Steam Runtime-based solution working. Can anyone here elaborate on exactly what will fix the problem?

Nephyrin commented 7 years ago

The SDK 2013 page on the developer wiki has steps on setting up the standalone runtime.

This is an older way of doing things that is slightly awkward. The steam-runtime repository has newer steps to build a chroot based upon the runtime, which can also be used to create a container/etc. This is not well supported in the current SDK release, however, which references the /valve/steam-runtime path in the base makefile -- you may need to make some tweaks if you attempt to do things this way.

joedight commented 6 years ago

Sorry that I'm so late. You appear to be correct - before I was using the developer wiki SDK page, and I think something went wrong there. The steam-runtime instructions work, and, under that chroot, the SDK correctly compiles for me now. Thanks.

3331 commented 4 years ago

You can use -fabi-compat-version=2 to compile with a new gcc/g++