radj307 / ARRCON

Lightweight Source RCON client that works on Windows, macOS, & Linux.
GNU General Public License v3.0
173 stars 11 forks source link

macOS 10.9 and newer require `libstdc++` to be installed #12

Closed radj307 closed 4 months ago

radj307 commented 1 year ago

Summary

If you're using macOS 10.9 or later, you must install gcc via HomeBrew or some other package manager.
brew install gcc

Explanation

Apple no longer includes GCC's libstdc++ in new releases of macOS as of version 10.9, when it was replaced by Apple clang's libc++.

This is a problem because ARRCON is dependent on the libstdc++ standard library, and as such it is not compatible with libc++.

In order to install libstdc++, the gcc package (GNU Compiler Collection) must be installed by users via HomeBrew or some other package manager.

Netruk44 commented 9 months ago

I was attempting to run ARRCON on one of the M1 Macs and hit an error with missing gcc libraries, even after running brew install gcc as you mention in the readme.

The issue came down to the fact that because the ARRCON binary is x86, I needed to install the x86 version of homebrew and use that version of homebrew to run brew install gcc. After doing this, I was able to run ARRCON.

You might consider either adding a note for ARM-Mac users noting that they need to use the x86 version of Homebrew when running brew install gcc, or consider shipping an arm64 version of your executable that can use the arm64 gcc libraries (I have no clue how difficult that might be for you).

avatsaev commented 5 months ago

on macos 14.2.1 M3 pro i get these errors:

after running cmake --build build --config Release

/Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/optional:632:7: note: 'optional<opt3::variantarg>' is not literal because it has base class '__optional_move_assign_base<variantarg>' of non-literal type
    : private __optional_move_assign_base<_Tp>
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/avatsaev/ARRCON/ARRCON/main.cpp:2:
In file included from /Users/avatsaev/ARRCON/ARRCON/utils.hpp:17:
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1182:31: error: variable of non-literal type 'const std::set<variantarg>' cannot be defined in a constexpr function before C++2b
                        const std::set<variantarg> distinct{ this->begin(), this->end() };
                                                   ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/set:515:28: note: 'set<opt3::variantarg>' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
class _LIBCPP_TEMPLATE_VIS set
                           ^
In file included from /Users/avatsaev/ARRCON/ARRCON/main.cpp:2:
In file included from /Users/avatsaev/ARRCON/ARRCON/utils.hpp:17:
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1593:42: error: constexpr function's return type 'variant_template_group' is not a literal type
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1373:9: note: 'variant_template_group' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
        struct variant_template_group {
               ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1609:42: error: constexpr function's return type 'variant_template_group' is not a literal type
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1373:9: note: 'variant_template_group' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
        struct variant_template_group {
               ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1624:42: error: constexpr function's return type 'variant_template_group' is not a literal type
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1373:9: note: 'variant_template_group' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
        struct variant_template_group {
               ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1638:42: error: constexpr function's return type 'variant_template_group' is not a literal type
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1373:9: note: 'variant_template_group' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
        struct variant_template_group {
               ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1651:42: error: constexpr function's return type 'variant_template_group' is not a literal type
        inline constexpr variant_template_group make_template(Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1373:9: note: 'variant_template_group' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
        struct variant_template_group {
               ^
/Users/avatsaev/ARRCON/ARRCON/main.cpp:17:4: error: no matching function for call to 'make_template'
                        opt3::make_template(opt3::CaptureStyle::Required, opt3::ConflictStyle::Conflict, 'H', "host"),
                        ^~~~~~~~~~~~~~~~~~~
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1593:42: note: candidate template ignored: substitution failure [with Ts = <char, const char (&)[5]>]
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1609:42: note: candidate function template not viable: no known conversion from 'opt3::CaptureStyle' to 'const ConflictStyle' for 1st argument
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1624:42: note: candidate template ignored: substitution failure [with Ts = <opt3::ConflictStyle, char, const char (&)[5]>]
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1638:42: note: candidate function template not viable: no known conversion from 'opt3::CaptureStyle' to 'const ConflictStyle' for 1st argument
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1651:42: note: candidate template ignored: substitution failure [with Ts = <opt3::CaptureStyle, opt3::ConflictStyle, char, const char (&)[5]>]
        inline constexpr variant_template_group make_template(Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1662:45: note: candidate function not viable: requires single argument 'g', but 4 arguments were provided
        inline WINCONSTEXPR variant_template_group make_template(variant_template_group const& g) { return g; }
                                                   ^
/Users/avatsaev/ARRCON/ARRCON/main.cpp:18:4: error: no matching function for call to 'make_template'
                        opt3::make_template(opt3::CaptureStyle::Required, opt3::ConflictStyle::Conflict, 'S', "saved"),
                        ^~~~~~~~~~~~~~~~~~~
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1593:42: note: candidate template ignored: substitution failure [with Ts = <char, const char (&)[6]>]
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1609:42: note: candidate function template not viable: no known conversion from 'opt3::CaptureStyle' to 'const ConflictStyle' for 1st argument
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1624:42: note: candidate template ignored: substitution failure [with Ts = <opt3::ConflictStyle, char, const char (&)[6]>]
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1638:42: note: candidate function template not viable: no known conversion from 'opt3::CaptureStyle' to 'const ConflictStyle' for 1st argument
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1651:42: note: candidate template ignored: substitution failure [with Ts = <opt3::CaptureStyle, opt3::ConflictStyle, char, const char (&)[6]>]
        inline constexpr variant_template_group make_template(Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1662:45: note: candidate function not viable: requires single argument 'g', but 4 arguments were provided
        inline WINCONSTEXPR variant_template_group make_template(variant_template_group const& g) { return g; }
                                                   ^
/Users/avatsaev/ARRCON/ARRCON/main.cpp:19:4: error: no matching function for call to 'make_template'
                        opt3::make_template(opt3::CaptureStyle::Required, opt3::ConflictStyle::Conflict, 'P', "port"),
                        ^~~~~~~~~~~~~~~~~~~
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1593:42: note: candidate template ignored: substitution failure [with Ts = <char, const char (&)[5]>]
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1609:42: note: candidate function template not viable: no known conversion from 'opt3::CaptureStyle' to 'const ConflictStyle' for 1st argument
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1624:42: note: candidate template ignored: substitution failure [with Ts = <opt3::ConflictStyle, char, const char (&)[5]>]
        inline constexpr variant_template_group make_template(const CaptureStyle captureStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1638:42: note: candidate function template not viable: no known conversion from 'opt3::CaptureStyle' to 'const ConflictStyle' for 1st argument
        inline constexpr variant_template_group make_template(const ConflictStyle conflictStyle, Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1651:42: note: candidate template ignored: substitution failure [with Ts = <opt3::CaptureStyle, opt3::ConflictStyle, char, const char (&)[5]>]
        inline constexpr variant_template_group make_template(Ts&&... args)
                                                ^
/Users/avatsaev/ARRCON/307lib/shared/include/opt3.hpp:1662:45: note: candidate function not viable: requires single argument 'g', but 4 arguments were provided
        inline WINCONSTEXPR variant_template_group make_template(variant_template_group const& g) { return g; }
                                                   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
ninja: build stopped: subcommand failed.
justinnichols commented 5 months ago

Just an FYI that hopefully helps anyone for building on Apple Silicon Macs. I am on macOS Sonoma 14.2.1 on a MacBook Air 15-inch, M2, 2023. I successfully built ARRCON by performing the following:

$> brew install gcc cmake ninja
$> cmake -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-13 -DCMAKE_CXX_COMPILER=/opt/homebrew/bin/g++-13 -B build -DCMAKE_BUILD_TYPE=Release -G Ninjabuild build --config Release
$> cmake --build build --config Release
$> ./build/ARRCON/ARRCON --help

I also have the latest XCode and XCode command line tools installed.

radj307 commented 4 months ago

Resolved in v4.0.0-pr2 by migrating to clang (min. version 16) instead of gcc.