As described in this comment, the implementation of libscrnsave (and I think libscrnsavw) are empty, making it impossible to build windows screen savers with mingw-w64.
Looks like it has been disabled since forever. Code needs major fixing to work.
I have spoken to the developer who wrote it, it seems like whatever the code contained in it previously were more of example codes, the library is supposed to be empty.
Closing as invalid.
Why is it invalid? Even if the commented out code was just examples, libscrnsave and libscrnsavw are part of the windows API and I can assure you they aren't empty. Is there a reason they shouldn't be implemented by mingw-w64? Standard mingw has them implemented.
It is invalid, because your assumption is wrong.
Of course it is possible to write screensavers with mingw-w64. See for this the header scrnsave.h in our header-set.
The implementation in scrnsave.c is more a sample-code to see how to implement this API present in scrnsave.h header.
This code was disabled by intention due it has some major defects and nobody spent time on it to fix it. So I doubt that you are able to write by it (and it is btw the same code as present in mingw.org's stuff) working and stable screen-savers.
If you want to spent time on improving this code, we might reconsider to provide a library for it.
Ok, I understand your point that what is currently in scrnsave.c is not simply "disabled" working code, and of course it is possible to create a screensaver with mingw-w64. However, it is not possible to take a working code base which implements a screen saver using the standard libscrnsave API and build it under mingw-w64.
Honestly, I haven't looked at the implementation in mingw.org's library, but their library is at least functional enough that I've written several screen savers against it without noticing any problems.
So maybe this shouldn't be classified as a defect or a bug: I'm not sure how this project is scoped with regards to completeness of the Windows API. Personally, I would suggest it stay open (or be moved) as a "TODO" item or something of that nature, but I guess that just depends on how the project is managed.
I will take a look at the code in scrnsave.c to see if I can improve it. It may be over my head for a while, but I'll see what I can do.
I've taken a cursory look at scrnsave.c: I don't see anything major wrong with it. Granted it's a little rough around the edges, but overall it seems reasonable. Are there any specific issues for it documented somewhere, or is it assumed that it just needs a complete rewrite?
No, we don't need necessarily a rewrite of it. For me there is just the question, if it works. The tests we did with this piece of source was done long time ago ... we had bugs at that time and it might be that source works as desired ...
So it would be great if somebody using it, could test it a bit.
The only thing I see is that the wide-variant of it isn't supported. We support that (-municode switch on command-line of gcc). So it might be worth to port that code to support wide-character-set too.
I am in the process of updating my FMSLogo project to use i686-w64-mingw32 for all of its executables. I ran into this issue when updating the screensaver from mingw.org to w64.
For the sake of searchability, here are the build errors that I had:
obj/1033-screensaver.o:screensaver.cpp:(.text+0x12f): undefined reference to `DefScreenSaverProc@16'
obj/1033-screensaver.o:screensaver.cpp:(.text+0x84d): undefined reference to `DefScreenSaverProc@16'
obj/1033-screensaver.o:screensaver.cpp:(.text+0x889): undefined reference to `DefScreenSaverProc@16'
/usr/i686-w64-mingw32/sys root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o): In function
/usr/src/debug/mingw64-i686-runtime-4.0.2-1/crt/crt0_c.c:18: undefined reference to `WinMain@16'
I worked around the empty libscrnsave.a by copying mingw-w64-crt\libsrc\scrnsave.c directly into my project and removing the "#if 0" preprocessor directive. Care should be taken to omit this file when building with the Microsoft SDK, since it has a scrnsave.lib library.
@Kai Tietz - I can confirm that scrnsave.c works for my purpose (ANSI build, 32-bit, Windows XP).
Log in to post a comment.