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 1540 - SDL 2.0 won't link on Visual Studio 2012 RC for x64
Summary: SDL 2.0 won't link on Visual Studio 2012 RC for x64
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: haptic (show other bugs)
Version: HG 2.0
Hardware: x86_64 Windows 7
: P2 blocker
Assignee: Edgar Simo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-09 11:16 UTC by Marek Pokorny
Modified: 2012-07-11 05:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Pokorny 2012-07-09 11:16:52 UTC
I don't know if this is the right place for this, but here it goes.

SDL 2.0 fails to link on Visual Studio 2012 RC. It does fine for 32 bit, but for 64 bit it fails with these errors:

1>     Creating library x64\Release\SDL.lib and object x64\Release\SDL.exp
1>SDL_syshaptic.obj : error LNK2019: unresolved external symbol memcpy referenced in function SDL_SYS_HapticOpen
1>SDL_windowsmodes.obj : error LNK2001: unresolved external symbol memcpy
1>x64\Release\SDL.dll : fatal error LNK1120: 1 unresolved externals

I'm using the June 2010 DirectX SDK, and I'm using the visual studio 2010 project (converted to vs2012 project)
Comment 1 Edgar Simo 2012-07-09 13:27:50 UTC
Sam, all function calls are to SDL_memcpy not memcpy. So perhaps it is being detected as HAVE_MEMCPY when it shouldn't? Don't know why the error doesn't reference other places, maybe it's just the first time it finds it?
Comment 2 Marek Pokorny 2012-07-09 15:29:21 UTC
I think I found the problem. In SDL_stdlib.c line 37:

/* The optimizer on Visual Studio 2010 generates memcpy() calls */
#if _MSC_VER == 1600 && defined(_WIN64) && !defined(_DEBUG)
#include <intrin.h>

#pragma function(memcpy)
void * memcpy ( void * destination, const void * source, size_t num )
{
...


When I changed it to _MSC_VER == 1700 (the version used for vs2012rc) it compiled and linked perfectly. Perhaps this should be changed to _MSC_VER >= 1600.
Comment 3 Sam Lantinga 2012-07-11 05:58:18 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/3ef4d0e923cb