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

not support to build as submodule on macOS #1119

Closed
kgbook opened this issue Apr 17, 2019 · 2 comments
Closed

not support to build as submodule on macOS #1119

kgbook opened this issue Apr 17, 2019 · 2 comments

Comments

@kgbook
Copy link

kgbook commented Apr 17, 2019

I installed the fmt using brew install fmt, but found fmt 5.3.0 version not work on my computer, see issue #1115 .

So I add submodule fmt using git submodule add https://github.com/fmtlib/fmt.git.

It’s ok if I build solely, but not if built as submodule.

OS: macOS Mojave 10.14.4
fmt: the latest version of the master branch
cmake : 3.14.1
g++:

Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Log:

Scanning dependencies of target skeleton_cpplint
Scanning dependencies of target fmt
[  0%] Linting skeleton_cpplint
[  1%] Building CXX object fmt/CMakeFiles/fmt.dir/src/format.cc.o
Done processing /Users/kang/project/sample/RTSPServer/skeleton/exception.cpp
Done processing /Users/kang/project/sample/RTSPServer/skeleton/skeleton_service.cpp
Total errors found: 0
[  1%] Built target skeleton_cpplint
[  1%] Building CXX object fmt/CMakeFiles/fmt.dir/src/posix.cc.o
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:14:59: error: parameter
      type 'internal::buffer' (aka 'basic_buffer<char>') is an abstract class
bool (*instantiate_grisu2_format)(double, internal::buffer<char>&, int, bool,
                                                          ^
/usr/local/include/fmt/core.h:238:16: note: unimplemented pure virtual method
      'grow' in 'basic_buffer'
  virtual void grow(std::size_t capacity) = 0;
               ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:14:59: error: expected
      ')'
bool (*instantiate_grisu2_format)(double, internal::buffer<char>&, int, bool,
                                                          ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:14:34: note: to match
      this '('
bool (*instantiate_grisu2_format)(double, internal::buffer<char>&, int, bool,
                                 ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:15:43: error: address of
      overloaded function 'grisu2_format' does not match required type 'bool
      (double, fmt::v5::internal::basic_buffer<char>)'
                                  int&) = internal::grisu2_format;
                                          ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/fmt/format.h:1134:3: note: candidate template ignored: could
      not match 'fmt::v5::internal::basic_buffer<char> &' against
      'fmt::v5::internal::basic_buffer<char>'
  grisu2_format(Double, buffer &, core_format_specs) { return false; }
  ^
/usr/local/include/fmt/format-inl.h:716:5: note: candidate template ignored:
      could not match 'fmt::v5::internal::basic_buffer<char> &' against
      'fmt::v5::internal::basic_buffer<char>'
    grisu2_format(Double value, buffer &buf, core_format_specs specs) {
    ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:26:39: error: variable
      cannot be defined in an explicit instantiation; if this declaration is
      meant to be a variable definition, remove the 'template' keyword
template FMT_API void internal::buffer<char>::append(const char*, const char*);
~~~~~~~~~                             ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:26:33: error: variable
      has incomplete type 'void'
template FMT_API void internal::buffer<char>::append(const char*, const char*);
                                ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:26:39: error: expected
      ';' at end of declaration
template FMT_API void internal::buffer<char>::append(const char*, const char*);
                                      ^
                                      ;
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:26:39: error: expected
      unqualified-id
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:35:21: error: parameter
      type 'internal::buffer' (aka 'basic_buffer<char>') is an abstract class
    internal::buffer<char>&, string_view, basic_format_args<format_context>);
                    ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:35:21: error: expected
      ')'
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:34:63: note: to match
      this '('
template FMT_API format_context::iterator internal::vformat_to(
                                                              ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:34:53: error: explicit
      instantiation of 'vformat_to' does not refer to a function template,
      variable template, member function, member class, or static data member
template FMT_API format_context::iterator internal::vformat_to(
                                                    ^
/usr/local/include/fmt/format.h:3233:57: note: candidate template ignored: could
      not match 'basic_buffer<type-parameter-0-0> &' against
      'fmt::v5::internal::basic_buffer<char>'
typename buffer_context<Char>::type::iterator internal::vformat_to(
                                                        ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:37:72: error: parameter
      type 'internal::buffer' (aka 'basic_buffer<char>') is an abstract class
template FMT_API void internal::sprintf_format(double, internal::buffer<char>&,
                                                                       ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:37:72: error: expected
      ')'
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:37:47: note: to match
      this '('
template FMT_API void internal::sprintf_format(double, internal::buffer<char>&,
                                              ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:37:33: error: explicit
      instantiation of 'sprintf_format' does not refer to a function template,
      variable template, member function, member class, or static data member
template FMT_API void internal::sprintf_format(double, internal::buffer<char>&,
                                ^
/usr/local/include/fmt/format-inl.h:764:6: note: candidate template ignored:
      could not match 'fmt::v5::internal::basic_buffer<char> &' against
      'fmt::v5::internal::basic_buffer<char>'
void sprintf_format(Double value, internal::buffer &buf,
     ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:40:64: error: parameter
      type 'internal::buffer' (aka 'basic_buffer<char>') is an abstract class
                                               internal::buffer<char>&,
                                                               ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:40:64: error: expected
      ')'
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:39:47: note: to match
      this '('
template FMT_API void internal::sprintf_format(long double,
                                              ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:39:33: error: explicit
      instantiation of 'sprintf_format' does not refer to a function template,
      variable template, member function, member class, or static data member
template FMT_API void internal::sprintf_format(long double,
                                ^
/usr/local/include/fmt/format-inl.h:764:6: note: candidate template ignored:
      could not match 'fmt::v5::internal::basic_buffer<char> &' against
      'fmt::v5::internal::basic_buffer<char>'
void sprintf_format(Double value, internal::buffer &buf,
     ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:47:39: error: variable
      cannot be defined in an explicit instantiation; if this declaration is
      meant to be a variable definition, remove the 'template' keyword
template FMT_API void internal::buffer<wchar_t>::append(const wchar_t*,
~~~~~~~~~                             ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:47:33: error: variable
      has incomplete type 'void'
template FMT_API void internal::buffer<wchar_t>::append(const wchar_t*,
                                ^
/Users/kang/project/sample/RTSPServer/fmt/src/format.cc:47:39: error: expected
      ';' at end of declaration
template FMT_API void internal::buffer<wchar_t>::append(const wchar_t*,
                                      ^
                                      ;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [fmt/CMakeFiles/fmt.dir/src/format.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
@vitaut
Copy link
Contributor

vitaut commented Apr 17, 2019

Whether it's a git submodule or not is irrelevant. Please provide the commands (and if necessary code) to repro.

@kgbook
Copy link
Author

kgbook commented Apr 18, 2019

It's ok now.
I forgot to add include_directories(${CMAKE_CURRENT_SOURCE_DIR}/fmt/include).
It's my mistake.
Thank you.

@kgbook kgbook closed this as completed Apr 18, 2019
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

2 participants