Page 1 of 1

hidapi.cpp errors

Posted: Sun Jan 22, 2023 3:22 pm
by Ayato
Hi all!


I try to compile qlc but nothing helps, I always get the following errors:

Osx 12.6.2
Xcode 14.2
Qt 5.15.2

Code: Select all

macx/hidapi.cpp:285:17: error: variable 'chars_copied' set but not used [-Werror,-Wunused-but-set-variable]
        CFIndex chars_copied;
                ^
macx/hidapi.cpp:451:20: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
            size_t len;
                   ^
macx/hidapi.cpp:728:17: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
                sprintf(str, "HIDAPI_%p", os_dev);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
macx/hidapi.cpp:707:16: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
        size_t len;
               ^
4 errors generated.
make[2]: *** [hidapi.o] Error 1
make[1]: *** [sub-hid-make_first] Error 2
make: *** [sub-plugins-make_first-ordered] Error 2

I have however followed the instructions given on the github wiki for the development environment but no luck.

Am I doing something wrong?


I also tried the qmltoqt6 branch with Qt 6.4.1 but got this error:

Code: Select all

virtualconsole/vcmatrix.cpp:469:9: error: ignoring temporary created by a constructor declared with 'nodiscard' attribute [-Werror,-Wunused-value]
        QMutexLocker(&matrix->algorithmMutex());
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [vcmatrix.o] Error 1
make[1]: *** [sub-src-make_first-ordered] Error 2
make: *** [sub-ui-make_first-ordered] Error 2

Re: hidapi.cpp errors

Posted: Tue Mar 14, 2023 9:40 pm
by sandinak
In the same boat here.. trying to build so I can run tests locally and not use up the CI/CD ;)

Re: hidapi.cpp errors

Posted: Wed Mar 15, 2023 8:19 am
by mcallegari
I have applied a couple of (blind) fixes upstream
Please try again now
Later tonight I'll test the change myself too

Re: hidapi.cpp errors

Posted: Wed Mar 15, 2023 12:35 pm
by sandinak
So this works with one change:
make run needs

Code: Select all

DYLD_LIBRARY_PATH=${LD_LIBRARY_PATH}  
I also am able to use

Code: Select all

make -j 16 
cleanly .. that's awesome!

I will do some more testing but looks good so far. Thanks for the quick fix. I'll try to get more involved in some of the fixes and features :)

FWIW .. this also now works using `brew` based installation vs macports and i'll write an update doc for that if you're interested.

Re: hidapi.cpp errors

Posted: Wed Mar 15, 2023 12:54 pm
by mcallegari
I also hit this build issue that was easy to solve.
I recently purchased a mac mini m2 and was setting it up with brew. I want to invest some more time on Homebrew
Last time I checked, the problem was not quite building, but rather creating a good DMG bundle.
i'll try again in the next days.

Re: hidapi.cpp errors

Posted: Wed Mar 15, 2023 1:18 pm
by sandinak
Thanks much. I have a few spare intel Mini's as well if you want to use one as a build host, happy to donate to the cause as most of my run-time systems are still Intel.