We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1955

Summary: CMakeLists.txt doesn't pull in src/thread/windows/SDL_systls.c
Product: SDL Reporter: Charles Huber <genpfault>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 2.0.0   
Hardware: x86_64   
OS: Windows 7   

Description Charles Huber 2013-07-10 18:01:04 UTC
Working from SDL-2.0.0-7392.zip.

A CMake-generated x64 VS2012 shared-library project fails to link with:

2>SDL_thread.obj : error LNK2019: unresolved external symbol SDL_TLSCreate referenced in function SDL_GetErrBuf
2>SDL_thread.obj : error LNK2019: unresolved external symbol SDL_TLSGet referenced in function SDL_GetErrBuf
2>SDL_thread.obj : error LNK2019: unresolved external symbol SDL_TLSSet referenced in function SDL_GetErrBuf

Looks like there should be an extra line in CMakeLists.txt around line 797, something like this:

  if(SDL_THREADS)
    set(SDL_THREAD_WINDOWS 1)
    set(SOURCE_FILES ${SOURCE_FILES}
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_syssem.c
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systhread.c
      # add this line:
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systls.c      
      ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c)
    set(HAVE_SDL_THREADS TRUE)
  endif(SDL_THREADS)
Comment 1 Ryan C. Gordon 2013-07-10 23:44:05 UTC
Fixed in hg changeset c1b80390a820, thanks!

--ryan.