The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Failed to load SHCORE.DLL
BenoitRen


Joined: 26 Feb 2010
Posts: 41
Location: Belgium
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.
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
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.
Failed to load SHCORE.DLL
Jonny D


Joined: 12 Sep 2009
Posts: 932
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 D




On Thu, Aug 11, 2016 at 5:12 PM, MrTAToad wrote:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Failed to load SHCORE.DLL
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
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:

Quote:
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.


Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Failed to load SHCORE.DLL
Jonny D


Joined: 12 Sep 2009
Posts: 932
As long as XP is still supported by SDL, that wouldn't solve the problem.

Jonny D


On Thursday, August 11, 2016, Jesse Palser wrote:
Quote:

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:

Quote:
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.


Quote:
_______________________________________________
SDL mailing list
[url=javascript:_e(%7B%7D,'cvml','');][/url]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Failed to load SHCORE.DLL
alabouza


Joined: 08 Dec 2009
Posts: 48
Location: Sao Paulo , Brasil
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


On Thu, Aug 11, 2016 at 7:22 PM, Jonathan Dearborn wrote:
Quote:
As long as XP is still supported by SDL, that wouldn't solve the problem.

Jonny D


On Thursday, August 11, 2016, Jesse Palser wrote:
Quote:

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:

Quote:
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.


Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org






_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

alabouza


Joined: 08 Dec 2009
Posts: 48
Location: Sao Paulo , Brasil
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
Re: Failed to load SHCORE.DLL
BenoitRen


Joined: 26 Feb 2010
Posts: 41
Location: Belgium
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.
BenoitRen


Joined: 26 Feb 2010
Posts: 41
Location: Belgium
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.