Failed to load SHCORE.DLL

Greetings

My SDL2 application doesn’t run correctly. No window gets created, but the return values don’t indicate an error. If I call SDL_GetError anyway and print its result, it says that SHCORE.DLL could not be found. I found another message about this on this mailing list, but there was no reply.

I’m using MinGW on Windows XP SP3, and I made sure to use the headers, libraries and DLL from i686-w64-mingw32. The “w64” worries me, though. But compiling with the regular includes and the libs under x86 produced an error about main being defined twice.

I’ve read the readme files but they didn’t contain anything useful.

For the “main is defined twice” error, all you need to do is use
Code:
#undef main

before your main function.

It sounds like your operating system is 32-bit and its trying to use the 64-bit version of SHCORE.DLL - if you use the #undef and the 32-bit libraries it should work.

It is not recommended to #undef main. Link to sdl2main instead. If you
still get link errors, then you probably have the wrong binaries for your
compiler. mingw32 is distinct from mingw-w64 and may have
incompatibilities.

Jonny DOn Thu, Aug 11, 2016 at 5:12 PM, MrTAToad wrote:

For the “main is defined twice” error, all you need to do is use

Code:

#undef main

before your main function.

It sounds like your operating system is 32-bit and its trying to use the
64-bit version of SHCORE.DLL - if you use the #undef and the 32-bit
libraries it should work.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Umm…

Windows XP has been dead for some time now and is buried - update to a
more recent Windows…

JesseOn 08/11/2016 04:18 PM, BenoitRen wrote:

Greetings

My SDL2 application doesn’t run correctly. No window gets created, but
the return values don’t indicate an error. If I call SDL_GetError
anyway and print its result, it says that SHCORE.DLL could not be
found. I found another message about this on this mailing list, but
there was no reply.

I’m using MinGW on Windows XP SP3, and I made sure to use the headers,
libraries and DLL from i686-w64-mingw32. The “w64” worries me, though.
But compiling with the regular includes and the libs under x86
produced an error about main being defined twice.

I’ve read the readme files but they didn’t contain anything useful.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

As long as XP is still supported by SDL, that wouldn’t solve the problem.

Jonny DOn Thursday, August 11, 2016, Jesse Palser < jessepalsermailinglists at gmail.com> wrote:

Umm…

Windows XP has been dead for some time now and is buried - update to a
more recent Windows…

Jesse

On 08/11/2016 04:18 PM, BenoitRen wrote:

Greetings

My SDL2 application doesn’t run correctly. No window gets created, but the
return values don’t indicate an error. If I call SDL_GetError anyway and
print its result, it says that SHCORE.DLL could not be found. I found
another message about this on this mailing list, but there was no reply.

I’m using MinGW on Windows XP SP3, and I made sure to use the headers,
libraries and DLL from i686-w64-mingw32. The “w64” worries me, though. But
compiling with the regular includes and the libs under x86 produced an
error about main being defined twice.

I’ve read the readme files but they didn’t contain anything useful.


SDL mailing listSDL at lists.libsdl.org <javascript:_e(%7B%7D,‘cvml’,‘SDL at lists.libsdl.org’);>http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

The only complain that I frequently have with XP is lack of support for
hardware acceleration.
So, for Windows XP you need the parachute of SDL_RENDERER_SOFTWARE when
you call SDL_CreateRenderer()

Armando ABOn Thu, Aug 11, 2016 at 7:22 PM, Jonathan Dearborn wrote:

As long as XP is still supported by SDL, that wouldn’t solve the problem.

Jonny D

On Thursday, August 11, 2016, Jesse Palser <jessepalsermailinglists@ gmail.com> wrote:

Umm…

Windows XP has been dead for some time now and is buried - update to a
more recent Windows…

Jesse

On 08/11/2016 04:18 PM, BenoitRen wrote:

Greetings

My SDL2 application doesn’t run correctly. No window gets created, but
the return values don’t indicate an error. If I call SDL_GetError anyway
and print its result, it says that SHCORE.DLL could not be found. I found
another message about this on this mailing list, but there was no reply.

I’m using MinGW on Windows XP SP3, and I made sure to use the headers,
libraries and DLL from i686-w64-mingw32. The “w64” worries me, though. But
compiling with the regular includes and the libs under x86 produced an
error about main being defined twice.

I’ve read the readme files but they didn’t contain anything useful.


SDL mailing listSDL at lists.libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

The only complain that I frequently have with XP is lack of support for hardware acceleration.
So, for Windows XP you need the parachute of SDL_RENDERER_SOFTWARE when you call SDL_CreateRenderer()

Armando AB------------------------
Armando Alaminos Bouza

Jonny D wrote:

mingw32 is distinct from mingw-w64 and may have incompatibilities.

I understand that, but I used i686-w64-mingw32, so I should have been compiling against and using the 32-bit binaries.

JeZ-l-Lee wrote:

Umm…
Windows XP has been dead for some time now and is buried - update to a more recent Windows…

Please leave this childish attitude off this mailing list, thank you.

alabouza wrote:

The only complain that I frequently have with XP is lack of support for hardware acceleration.

I recall reading that you get hardware acceleration if you use full-screen mode. It makes me wonder why, because surely a Windows application doesn’t need to be full-screen to make use of hardware acceleration. For what it’s worth, the same limitation existed for SDL 1.2.

I’ve found my problem. My program was stalling because it couldn’t find an INI file (forgot to copy my assets and configuration files), a situation I did not foresee, causing the program to get stuck somehow. The error about SHCORE.DLL is the last internal error that SDL2 detected, but it was not blocking and unrelated.

Now my window appeared, but it remained blank. I fixed this problem as well, which, in a way, is because of an undocumented change that isn’t mentioned in the migration guide.

In SDL 1.2, if you wanted to copy (part of) a surface to another, you used SDL_BlitSurface. The fourth argument, dstrect, specified at what position on the destination surface you wanted to copy the source surface to. The documentation states “Only the position is used in the dstrect (the width and height are ignored).”.

In SDL 2.0, if you want to copy (part of) a texture to the current rendering target, you use SDL_RenderCopy. This works like SDL_BlitSurface, except for one important change: the width and height in dstrect are /not/ ignored. So if you were like me and just set those two values to zero, nothing would get copied. You need to specify the width and height of what you want to copy. If you want to copy part of a texture, you can use the dimensions of srcrect. But if you want to copy the entirety of the source texture, you have to query its dimensions, because unlike SDL_Surface, SDL_Texture does not have its dimensions as struct members.