sfztools/sfizz-ui

C++ errors

yurivict opened this issue · 5 comments

In file included from /disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/animator.cpp:92:
In file included from /disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/animator.h:7:
In file included from /disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../vstguifwd.h:7:
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../vstguibase.h:149:3: error: unsupported compiler
        #error unsupported compiler
         ^
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../vstguibase.h:358:16: error: no member named 'move' in namespace 'std'
                *this = std::move (op);
                        ~~~~~^
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../vstguibase.h:426:15: error: no member named 'move' in namespace 'std'
        *this = std::move (mp);
                ~~~~~^
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../vstguibase.h:475:39: error: no member named 'forward' in namespace 'std'
        return SharedPointer<I> (new I (std::forward<Args>(args)...), false);
                                        ~~~~~^
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../vstguibase.h:475:47: error: 'Args' does not refer to a value
        return SharedPointer<I> (new I (std::forward<Args>(args)...), false);
                                                     ^
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../vstguibase.h:472:32: note: declared here
template <class I, typename ...Args>
                               ^
In file included from /disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/animator.cpp:98:
In file included from /disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../platform/platformfactory.h:8:
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../platform/platformfwd.h:34:1: error: static_assert failed "unknown platform"
static_assert (false, "unknown platform");
^              ~~~~~
In file included from /disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/animator.cpp:98:
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/animation/../platform/platformfactory.h:21:20: error: unknown type name 'PlatformInstanceHandle'
void initPlatform (PlatformInstanceHandle instance);
                   ^
7 errors generated.

/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/platform/linux/x11fileselector.cpp:209:7: error: use of undeclared identifier 'execvpe'; did you mean 'execve'?
                if (execvpe (argv[0], argv, envp) == -1)
                    ^~~~~~~
                    execve
/usr/include/unistd.h:336:6: note: 'execve' declared here
int      execve(const char *, char * const *, char * const *);
         ^
/disk-samsung/freebsd-ports/audio/sfizz/work/sfizz-1.2.0/plugins/editor/external/vstgui4/vstgui/lib/platform/linux/x11fileselector.cpp:237:15: warning: private field 'exDialogType' is not used [-Wunused-private-field]
        ExDialogType exDialogType{ExDialogType::none};
                     ^
1 warning and 1 error generated.

The first error unsupported compiler is bogus - it really checks OS, not compiler.
The rest are likely results of missing include statements.

Version: 1.2.0
FreeBSD 13.1

The first move/forward are either a missing #include <utility> or a C++11 flag that's not properly set up for this particular file.

The last error is my own patch, and execvpe has no equivalent in BSD land. I don't really have the spare time to support BSD at the moment but if you want to have a shot at these I'd gladly accept patches !

Note: all of these are problems in VSTGUI; our fork is at https://github.com/sfztools/vstgui if you want to submit tpatches there, or directly upstream even, although for other reasons we're not tracking the latest version right now.

Once unsupported compiler was solved with

-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__FreeBSD__)

the other errors disappeared.

The execvpe problem was patched with #define execvpe(a, b, c) execvp(a, b).

If you could add an option to use an external vstgui this would be the best solution.

@yurivict could it be OK having the possibility to build the entire SDK for sfizz from a "src package"? I see you have https://cgit.freebsd.org/ports/tree/audio/vst3sdk/ in Ports, though I don't see a pkgconfig file, or do you need a specific option for VSTGUI only?
Because we have a SFIZZ_USE_SYSTEM_VST3SDK CMake option, but it works finding the package using pkgconfig, it is used at least by Archlinux.
If needed here for reference their vst3sdk.pc file in their PKGBUILD repository.

I forgot to tell you that maybe you could be interested in this VSTGUI PR to use as patch, hoping they'll consider to merge it someday.

Closing, please reopen if needed.