Fixed bug 3552 - Building SDL in release mode fails under VS 2017 RC

Lukasz Biel

Tried to compile SDL2 using newest version of VS.

Got:
SDL_audiocvt.obj : error LNK2019: unresolved external symbol memcpy referenced in function SDL_ResampleCVT
1>E:\Users\dotPo\Lib\SDL\VisualC\x64\Release\SDL2.dll : fatal error LNK1120: 1 unresolved externals

whole compilation process: http://pastebin.com/eWDAvBce

Steps to reproduce:
clone http://hg.libsdl.org/SDL using tortoise hg,
open SDL\VisualC\SDL.sln,
when promted if should retarget solution click ok,
select release x64 build type,
Build/Build Solution

attempt 2, using Visual Studio cmake support:
open folder SDL\
select release x64 build type,
run CMake\Build CMakeLists.txt
build fails

When switched to debug build type, buils succeeds in both cases.
VS 2017 is still beta.
This commit is contained in:
Sam Lantinga 2017-01-09 20:37:52 -08:00
parent 23020f92fa
commit bf11cd5084
1 changed files with 1 additions and 4 deletions

View File

@ -378,13 +378,10 @@ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format
float *dst = (float *) (cvt->buf + srclen); float *dst = (float *) (cvt->buf + srclen);
const int dstlen = (cvt->len * cvt->len_mult) - srclen; const int dstlen = (cvt->len * cvt->len_mult) - srclen;
float state[8]; float state[8];
int i;
SDL_assert(format == AUDIO_F32SYS); SDL_assert(format == AUDIO_F32SYS);
for (i = 0; i < chans; i++) { SDL_memcpy(state, src, chans*sizeof(*src));
state[i] = src[i];
}
cvt->len_cvt = SDL_ResampleAudioSimple(chans, cvt->rate_incr, state, src, srclen, dst, dstlen); cvt->len_cvt = SDL_ResampleAudioSimple(chans, cvt->rate_incr, state, src, srclen, dst, dstlen);