leadedge / Spout2

A video frame sharing system for Microsoft Windows
BSD 2-Clause "Simplified" License
760 stars 138 forks source link

Fix MinGW error (beta branch) #93

Closed vkedwardli closed 1 year ago

vkedwardli commented 1 year ago

Cherry-picked, not verified

Let's see if it can compiles successfully: https://github.com/vkedwardli/flycast/actions/runs/5369067144

leadedge commented 1 year ago

Will do.

vkedwardli commented 1 year ago
image

Should be working.

What is the difference between beta and master branch btw?

leadedge commented 1 year ago

All builds correctly with Visual Studio, so it's good to go.

But I am unsure whether these changes will affect those made for MinGW with GCC/Clang by Jean-Michaël Celerier. Can you confirm?

In fact, the Binaries folder has become redundant with the introduction of the INSTALL project contributed by Joakim Kilby. This produces an INSTALL folder with convenient sub-folders for the dll, lib and header files. The ultimate plan is to remove the binaries folder and modify the CMake files to remove the post-build copy. But that won't be in the short term.

The UNREFERENCED_PARAMETER issue in Spout.cpp is better placed in SpoutCommon.h, since it may be used elsewhere in future. I will do that along with other revisions.

The SPOUT_BUILD_DLL define was contributed by Malcolm Bechard and intended for Visual Studio. Removal of the "_MSC_VER" condition does not affect Visual Studio and if it works with MinGW, it should not be necessary.

Beta branch is where changes are accumulated and are available for public use. Accumulated changes are transferred to the master branch when testing is completed and no issues are reported. It's always best to submit pull requests to the beta branch so that the changes do not get out of sync. I will update the readme file when I get the time.

vkedwardli commented 1 year ago

But I am unsure whether these changes will affect those made for MinGW with GCC/Clang by Jean-Michaël Celerier. Can you confirm?

It is working in my GitHub runner test build, both CMake + MinGW and CMake + MSVC compiled and can run successfully

The UNREFERENCED_PARAMETER issue in Spout.cpp is better placed in SpoutCommon.h

yes I tried before, it doesn’t work, so I put it in Spout.cpp directly

leadedge commented 1 year ago

For GCC/Clang, I think that Jean-Michaël will have to look at this directly.

UNREFERENCED_PARAMETER definition within in Spout.cpp is not a good solution, or every time I use this I will have to make the make the same change to the source file.

Try this - in SpoutGl.h change the order of includes to :

include "SpoutCommon.h"

include "SpoutGLextensions.h"

leadedge commented 1 year ago

I will remove the unused argument from the function in question. This will not make any difference. Meanwhile the definition in Spout.cpp can remain where it is to get things working.

@jcelerier - could you check the CMake changes with your build system

jcelerier commented 1 year ago

hey! I'm in a bit of a rush but can try later in the week, thanks for keeping me in the loop!

leadedge commented 1 year ago

Thanks for responding so quickly. No problems and no rush here at all.