Lock/unlock mutex and visual studio

Hi,
I compiled the latest SDL snapshot in vs10 without changing its config.

Now, using the generated .dll/.lib file in my separate project I got two
unresolved symbols:
1>VSLDCL.obj : error LNK2019: unresolved external symbol _SDL_LockMutex
referenced in function “void * __cdecl lock(void *,void * *)” (?lock@
@YAPAXPAXPAPAX at Z)
1>VSLDCL.obj : error LNK2019: unresolved external symbol _SDL_UnlockMutex
referenced in function “void __cdecl unlock(void *,void *,void * const *)”
(?unlock@@YAXPAX0PBQAX at Z)
1>c:\users\vittorio.giovara\documents\visual studio
2010\Projects\VSLDCL\Debug\VSLDCL.exe : fatal error LNK1120: 2 unresolved
externals

I’ve looked at config_windows.h but found nothing interesting; does it
happen to other people as well?
Vittorio

I find this confused and in fact wrong: in begin_code.h:

/* Some compilers use a special export keyword */
#ifndef DECLSPEC

if defined(BEOS) || defined(HAIKU)

if defined(GNUC)

define DECLSPEC __declspec(dllexport)

else

define DECLSPEC __declspec(export)

endif

elif defined(WIN32)

ifdef BORLANDC

ifdef BUILD_SDL

define DECLSPEC

else

define DECLSPEC __declspec(dllimport)

endif

else

define DECLSPEC __declspec(dllexport)

endif

else

if defined(GNUC) && GNUC >= 4

define DECLSPEC attribute ((visibility(“default”)))

else

define DECLSPEC

endif

endif

#endif

The problem is that __declspec(dllexport) is defined for MSVC++
whether or not BUILD_SDL is set. And what happened to
__declspec(dllimport)? And what happens if the linkage is static?

I have no idea if this breaks Windows entirely and it just happens
to complain about SDL_mutex first.

the other possibility is that the config macro:

SDL_THREAD_WINDOWS

is not set in SDL_config.h. In that case the file:

src/thread/windows/SDL_sysmutex.c

will compile to emptiness instead of defining any symbols.On 13/06/2013, at 10:53 PM, jasonl220 at gmail.com wrote:

Hi,
I compiled the latest SDL snapshot in vs10 without changing its config.

Now, using the generated .dll/.lib file in my separate project I got two unresolved symbols:
1>VSLDCL.obj : error LNK2019: unresolved external symbol _SDL_LockMutex referenced in function “void * __cdecl lock(void *,void * *)” (?lock@@YAPAXPAXPAPAX at Z)
1>VSLDCL.obj : error LNK2019: unresolved external symbol _SDL_UnlockMutex referenced in function “void __cdecl unlock(void *,void *,void * const *)” (?unlock@@YAXPAX0PBQAX at Z)
1>c:\users\vittorio.giovara\documents\visual studio 2010\Projects\VSLDCL\Debug\VSLDCL.exe : fatal error LNK1120: 2 unresolved externals


john skaller
@john_skaller
http://felix-lang.org