Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS build problems #1

Closed
kutsan opened this issue Jan 11, 2019 · 4 comments
Closed

macOS build problems #1

kutsan opened this issue Jan 11, 2019 · 4 comments

Comments

@kutsan
Copy link

kutsan commented Jan 11, 2019

This is the log after I typed ./build on macOS Mojave. I have no understanding of C++/C, so can't help much sorry. Tell me if anything needed.

And exit code is 2 according to echo $?.

Setting Environment Variables

Building peaclock in release mode

Compiling peaclock
-- The C compiler identification is AppleClang 10.0.0.10001044
-- The CXX compiler identification is AppleClang 10.0.0.10001044
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_BUILD_TYPE is release
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Kutsan/Documents/peaclock/build/release
Scanning dependencies of target peaclock
[ 20%] Building CXX object CMakeFiles/peaclock.dir/src/main.cc.o
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
[ 40%] Building CXX object CMakeFiles/peaclock.dir/src/ob/string.cc.o
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
[ 60%] Building CXX object CMakeFiles/peaclock.dir/src/peaclock/peaclock.cc.o
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
/Users/Kutsan/Documents/peaclock/src/peaclock/peaclock.cc:205:20: error: call to 'wrap' is ambiguous
            buf << aec::wrap(_config.symbol, {_config.style.active, _config.style.bold});
                   ^~~~~~~~~
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:367:13: note: candidate function [with T = std::__1::basic_string<char>]
std::string wrap(T const val_, std::string const attr_, bool color_ = true)
            ^
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:387:13: note: candidate function [with T = std::__1::basic_string<char>]
std::string wrap(T const val_, std::vector<std::string> const attr_, bool color_ = true)
            ^
/Users/Kutsan/Documents/peaclock/src/peaclock/peaclock.cc:210:20: error: call to 'wrap' is ambiguous
            buf << aec::wrap(_config.symbol, {_config.style.inactive, _config.style.bold});
                   ^~~~~~~~~
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:367:13: note: candidate function [with T = std::__1::basic_string<char>]
std::string wrap(T const val_, std::string const attr_, bool color_ = true)
            ^
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:387:13: note: candidate function [with T = std::__1::basic_string<char>]
std::string wrap(T const val_, std::vector<std::string> const attr_, bool color_ = true)
            ^
/Users/Kutsan/Documents/peaclock/src/peaclock/peaclock.cc:245:18: error: call to 'wrap' is ambiguous
          buf << aec::wrap(_digital_clock.at(i), {_config.style.active, _config.style.bold});
                 ^~~~~~~~~
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:367:13: note: candidate function [with T = int]
std::string wrap(T const val_, std::string const attr_, bool color_ = true)
            ^
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:387:13: note: candidate function [with T = int]
std::string wrap(T const val_, std::vector<std::string> const attr_, bool color_ = true)
            ^
/Users/Kutsan/Documents/peaclock/src/peaclock/peaclock.cc:251:22: error: call to 'wrap' is ambiguous
              buf << aec::wrap(":", {_config.style.inactive, _config.style.bold});
                     ^~~~~~~~~
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:367:13: note: candidate function [with T = const char *]
std::string wrap(T const val_, std::string const attr_, bool color_ = true)
            ^
/Users/Kutsan/Documents/peaclock/./src/ob/term.hh:387:13: note: candidate function [with T = const char *]
std::string wrap(T const val_, std::vector<std::string> const attr_, bool color_ = true)
            ^
4 errors generated.
make[2]: *** [CMakeFiles/peaclock.dir/src/peaclock/peaclock.cc.o] Error 1
make[1]: *** [CMakeFiles/peaclock.dir/all] Error 2
make: *** [all] Error 2

real    0m5.431s
user    0m4.703s
sys     0m0.532s
@ghost
Copy link

ghost commented Jan 11, 2019

Same issue on OpenBSD.

$ cmake --version
cmake version 3.10.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

How would I check if my compiler supports C++17?

Log from calling ./build.sh --debug: log.txt.

@octobanana
Copy link
Owner

Thank you both for the logs! To the best of my knowledge, it looks like some compilers don't take the argument types passed inside std::initializer_list into account when selecting an overloaded function.

Commit 5711f0f now makes the calls to the overloaded function wrap by explicitly passing the type instead of a std::initializer_list.

Could you try the latest release, 0.1.3, and see if it compiles alright?

@Dluzhnevsky
Copy link

@octobanana That problem is fixed, but the earlier MacOS versions face another problem:
error: call to unavailable member function 'value': introduced in macOS 10.14

A possible workaround is to remove the optional regex matches from string.cc and string.hh. Something like that:

-std::optional<std::vector<std::string>> match(std::string const& str, std::regex rx);
+std::vector<std::string> match(std::string const& str, std::regex rx);

The logic of the optional regex matches in peacock.cc should be refactored then, as there will be no more match_opt's.

I have tried it locally just now, but the result seems a bit strange. There were no errors during the compilation and the clock runs just fine, the digital numbers are changing, but the binary ones are all enabled. Maybe something else went wrong, or my changes were incorrect.

@kutsan
Copy link
Author

kutsan commented Jan 12, 2019

It now works for me in v0.1.3, thanks @octobanana!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants