magiblot / turbo

An experimental text editor based on Scintilla and Turbo Vision.
Other
466 stars 36 forks source link

macOS build errors in `/deps/fmt/` #30

Closed onderweg closed 2 years ago

onderweg commented 2 years ago

Hi, when building on macOS 12.4, arm64, with cmake --build . -j$(sysctl -n hw.logicalcpu)) build fails because of multiple build errors, originating in the fmt package.

Partial build output:

/my-repos/turbo/deps/fmt/src/os.cc:263:25: error: unknown type name 'error_code'; did you mean 'std::error_code'?
void file::dup2(int fd, error_code& ec) FMT_NOEXCEPT {
                        ^~~~~~~~~~
                        std::error_code
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/system_error:315:24: note: 'std::error_code' declared here
class _LIBCPP_TYPE_VIS error_code
                       ^
/my-repos/turbo/deps/fmt/src/os.cc:266:26: error: use of undeclared identifier 'error_code'; did you mean 'std::error_code'?
  if (result == -1) ec = error_code(errno);
                         ^
/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/system_error:315:24: note: 'std::error_code' declared here
class _LIBCPP_TYPE_VIS error_code
                       ^
2 errors generated.
make[2]: *** [deps/fmt/CMakeFiles/fmt.dir/src/os.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Any pointers to how to resolve this issue?

magiblot commented 2 years ago

Mhm... We can try to update the fmt dependency.

Run:

cd deps/fmt
git fetch
git checkout 8.1.1

And build again. If it still doesn't work, try:

cd deps/fmt
git fetch
git checkout master

Cheers.

onderweg commented 2 years ago

Thanks! That fixed it 😀