hidapi.cpp errors

Post Reply
Ayato
Posts: 9
Joined: Fri Jan 20, 2023 11:06 am
Real Name: Pierre

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
User avatar
sandinak
Posts: 188
Joined: Mon Apr 03, 2017 5:40 pm
Location: Yorktown, VA
Real Name: Branson Matheson
Contact:

In the same boat here.. trying to build so I can run tests locally and not use up the CI/CD ;)
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

I have applied a couple of (blind) fixes upstream
Please try again now
Later tonight I'll test the change myself too
User avatar
sandinak
Posts: 188
Joined: Mon Apr 03, 2017 5:40 pm
Location: Yorktown, VA
Real Name: Branson Matheson
Contact:

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.
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

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.
User avatar
sandinak
Posts: 188
Joined: Mon Apr 03, 2017 5:40 pm
Location: Yorktown, VA
Real Name: Branson Matheson
Contact:

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.
Post Reply