autolab / Autolab-CLI

Command line autolab client that uses the Autolab API
3 stars 2 forks source link

Build Error in Logger: logger.h:76:32: error: unused parameter 'val' [-Werror,-Wunused-parameter] #21

Closed awadell1 closed 1 year ago

awadell1 commented 3 years ago

I got the following error when trying to build on a Mac M1.

Any ideas on how to fix it?

Best,

Alex

alexwadell@Alexs-MBP build % git status   
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
alexwadell@Alexs-MBP build % git rev-parse HEAD
57713f2b1ac59bd1d2ac7602c36b4cbf7c1cb1e5
alexwadell@Alexs-MBP build % cmake .. -Drelease=ON
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Build type: Release
-- Build variant: 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/alexwadell/Autolab-CLI/build
alexwadell@Alexs-MBP build % gmake --version
GNU Make 4.3
Built for arm-apple-darwin20.2.0
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
alexwadell@Alexs-MBP build % gmake
[  5%] Building CXX object lib/logger/CMakeFiles/logger.dir/logger.cpp.o
In file included from /Users/alexwadell/Autolab-CLI/lib/logger/logger.cpp:1:
/Users/alexwadell/Autolab-CLI/lib/logger/./logger.h:76:32: error: unused parameter 'val' [-Werror,-Wunused-parameter]
    debug_logger &operator<<(T val) {
                               ^
1 error generated.
gmake[2]: *** [lib/logger/CMakeFiles/logger.dir/build.make:82: lib/logger/CMakeFiles/logger.dir/logger.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:285: lib/logger/CMakeFiles/logger.dir/all] Error 2
gmake: *** [Makefile:149: all] Error 2
alexwadell@Alexs-MBP build % gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: arm64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ashleyzhang commented 3 years ago

Hey Alex, I'm not too sure what's happening here, but could you try running gmake with the -Wno-unused-parameter option?

damianhxy commented 1 year ago

Closing as stale (the m1-build-fix branch should build on a m1 mac)