ct-Open-Source / micro-webservice

Micro-Webservice, implementiert mit Boost.Beast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build against Boost 1.81/1.182 fails

DannyBoyKN opened this issue · comments

commented

Ich versuche das Projekt auf meinem MacBookPro (BigSur 11.7.6) mit einem selbstgebauten Boost 1.81 zu erstellen. Für branch part2 war Boost 1.76 ausreichend, welches über MacPorts installiert werden konnte. Für branch part3 ist mindestens Boost 1.81 notwendig. Da mir Homebrew zu "schwerfällig" ist, bin ich schon länger auf MacPorts umgestiegen. Leider ist hier nur Boots 1.76 als package vorhanden. Deshalb habe ich Boost 1.81 als Archiv heruntergeladen, extrahiert und gebaut:

$ ./bootstrap.sh --prefx=...
$ ./b2 cxxflags=-std=c++17
$ ./b2 install

Mit export BOOST_ROOT=...wird der Basis-Ordner für die Boost Installation gesetzt. Damit bin ich dann ans Bauen gegangen:

micro-webservice/build ❯ cmake ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:1384 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:1507 (_Boost_COMPONENT_DEPENDENCIES)
  /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:2118 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:10 (find_package)


CMake Warning at /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:1384 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:1507 (_Boost_COMPONENT_DEPENDENCIES)
  /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:2118 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:10 (find_package)


CMake Warning at /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:2217 (message):
  No header defined for url; skipping header check (note: header-only
  libraries have no designated component)
Call Stack (most recent call first):
  CMakeLists.txt:10 (find_package)


CMake Error at /opt/local/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: url) (found suitable version "1.81.0",
  minimum required is "1.81.0")
Call Stack (most recent call first):
  /opt/local/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /opt/local/share/cmake-3.24/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args)
  CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!

Warum genau scheint hier etwas in der Boost Installation zu fehlen ?

Bei ./bootstrap.sh --prefx=... fehlt ein i in prefx. Außerdem sollten es zwei statt drei Punkte sein, gelle?! Letzteres gilt auch für export BOOST_ROOT=...
Vielleicht ist das Problem ja schon damit gelöst.

Oder kommt cmake vielleicht durcheinander, weil in den generierten Dateien im build-Verzeichnis noch Referenzen auf Boost 1.71.0 stecken? Dann müsste ein BOOST_ROOT=.. cmake --fresh .. helfen. Wenn auch das nichts bringt, könnten Sie einfach den kompletten Inhalts des build-Verzeichnisses löschen, bevor Sie BOOST_ROOT=.. cmake .. das nächste Mal starten.

macOS Ventura 13.3.1 hier, erfolgreiches Kompilieren gegen Boost 1.82.0 mit folgender Vorschrift:

Boost bauen

cd ~/Downloads
wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.7z
cd ~/tmp
7z x ~/Downloads/boost_1_82_0.7z
cd boost_1_82_0
./bootstrap.sh
./b2 cxxflags=-std=c++17
mkdir ~/Workspace
./b2 install --prefix=/Users/<placeholderforusername>/Workspace/boost_1_82_0

Webservice bauen

cd ~/Workspace
git clone https://github.com/ct-Open-Source/micro-webservice.git
cd micro-webservice
mkdir -p build
cd build
BOOST_ROOT=/Users/<placeholderforusername>/Workspace/boost_1_82_0 cmake --fresh -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

Es kommen ein paar Warnungen über die missbräuchliche Verwendung von sprintf() in Boost, aber sonst läuft der Compiler fehlerfrei durch.(gefixt durch ce4302b)

commented

In der Tat ... bei prefx fehlte das 'i' 😕 Ich könnte jetzt nicht mehr sagen, ob das nur ein typo beim Verfassen des Issues war oder sogar beim Versuch des Bauens 😕
Die '...' sind nur ein Platzhalter für mein Verzeichnis und nicht als Doppel-Punkt gedacht.

Ich hab das Ganze mit den aufgeführten Schritten nochmals nachvollzogen, und - siehe da - beim Webservice bauen ist der initiale cmake Fehler jetzt weg 😃

micro-webservice/build ❯ BOOST_ROOT=... cmake --fresh ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: boost/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found suitable version "1.82.0", minimum required is "1.81.0") found components: regex url 
-- Boost version: 1.82.0
-- Boost include dirs: boost/include
-- Boost lib dirs: boost/lib
-- Boost libs: Boost::regex;Boost::url
-- GMP include dir: /opt/local/include
-- GMP lib dir: /opt/local/lib
-- Configuring done
-- Generating done
-- Build files have been written to: ...

Danke!

Allerdings scheitert nun das cmake --build .:

-micro-webservice/build ❯ cmake --build .
[ 25%] Building CXX object CMakeFiles/prime-webservice.dir/main.cpp.o
In file included from micro-webservice/main.cpp:33:
In file included from micro-webservice/httpworker.hpp:31:
In file included from micro-webservice/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:18:
In file included from boost/include/boost/url/grammar/ci_string.hpp:15:
In file included from boost/include/boost/url/string_view.hpp:14:
In file included from boost/include/boost/url/detail/string_view.hpp:13:
boost/include/boost/core/detail/string_view.hpp:1253:13: error: explicit
      specialization of non-template struct 'basic_common_reference'
struct std::basic_common_reference<
            ^                     ~
boost/include/boost/core/detail/string_view.hpp:1253:13: error: 
      out-of-line definition of 'basic_common_reference' does not match any declaration in namespace
      'std'
struct std::basic_common_reference<
       ~~~~~^
In file included from micro-webservice/main.cpp:33:
...

Danke fürs Mitmachen 👍
Dass in Ihrem Kompiliervorgang noch Boost::regex eingebunden wird, verrät mir, dass Sie nicht den aktuellen Entwicklungsstand haben. Bitte einmal git checkout part3und git pull!

Der gezeigte Fehler deutet auf ein Problem hin, das seit 1.81.0 eigentlich nicht mehr bestehen sollte. Aber man weiß ja nie. Versuchen Sie doch bitte mal in der Datei CMakeLists.txt von den Zeilen

if (${Boost_VERSION} VERSION_LESS "1.81.0")
  add_definitions(-DUSE_STRINGVIEW_TOSTRING)
endif()

nur noch die mittlere zu behalten:

add_definitions(-DUSE_STRINGVIEW_TOSTRING)

Läuft der Build dann durch?

commented

Gerne, ich versuch damit tiefer in C++ einzusteigen... 😉

Ich hatte tatsächlich nicht den letzten Stand. Trotzdem, nach einem erneuten pull und auch mit der Änderung in CMakeLists.txt werden tonnenweise Fehler ausgespuckt. Hier der vollständige build log:

micro-webservice/build ❯ BOOST_ROOT=boost cmake --fresh  ..
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: boost/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found suitable version "1.82.0", minimum required is "1.81.0") found components: url 
-- Boost include dirs: boost/include
-- Boost lib dirs: boost/lib
-- Boost libs: Boost::url
-- GMP include dir: /opt/local/include
-- GMP lib dir: /opt/local/lib
-- Configuring done
-- Generating done
-- Build files have been written to: micro-webservice/build

micro-webservice/build ❯ cmake --build .
[ 25%] Building CXX object CMakeFiles/micro-webservice.dir/src/main.cpp.o
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:18:
In file included from boost/include/boost/url/grammar/ci_string.hpp:15:
In file included from boost/include/boost/url/string_view.hpp:14:
In file included from boost/include/boost/url/detail/string_view.hpp:13:
boost/include/boost/core/detail/string_view.hpp:1253:13: error: explicit
      specialization of non-template struct 'basic_common_reference'
struct std::basic_common_reference<
            ^                     ~
boost/include/boost/core/detail/string_view.hpp:1253:13: error: 
      out-of-line definition of 'basic_common_reference' does not match any declaration in namespace
      'std'
struct std::basic_common_reference<
       ~~~~~^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:39:12: error: no member named
      'throw_with_location' in namespace 'boost'
    boost::throw_with_location( system_error( e ), loc );
    ~~~~~~~^
boost/include/boost/system/result.hpp:44:12: error: no member named
      'throw_with_location' in namespace 'boost'
    boost::throw_with_location( system_error( make_error_code( e ) ), loc );
    ~~~~~~~^
boost/include/boost/system/result.hpp:49:12: error: no member named
      'throw_with_location' in namespace 'boost'
    boost::throw_with_location( std::system_error( e ), loc );
    ~~~~~~~^
boost/include/boost/system/result.hpp:54:12: error: no member named
      'throw_with_location' in namespace 'boost'
    boost::throw_with_location( std::system_error( make_error_code( e ) ), loc );
    ~~~~~~~^
boost/include/boost/system/result.hpp:65:16: error: no member named
      'throw_with_location' in namespace 'boost'
        boost::throw_with_location( std::bad_exception(), loc );
        ~~~~~~~^
boost/include/boost/system/result.hpp:268:20: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            return variant2::unsafe_get<0>( v_ );
                   ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:268:20: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            return variant2::unsafe_get<0>( v_ );
                   ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:272:41: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            throw_exception_from_error( variant2::unsafe_get<1>( v_ ), loc );
                                        ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:272:41: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            throw_exception_from_error( variant2::unsafe_get<1>( v_ ), loc );
                                        ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:280:20: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            return variant2::unsafe_get<0>( v_ );
                   ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:280:20: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            return variant2::unsafe_get<0>( v_ );
                   ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:284:41: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            throw_exception_from_error( variant2::unsafe_get<1>( v_ ), loc );
                                        ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:284:41: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            throw_exception_from_error( variant2::unsafe_get<1>( v_ ), loc );
                                        ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:407:29: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
        return has_error()? variant2::unsafe_get<1>( v_ ): E();
                            ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:407:29: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
        return has_error()? variant2::unsafe_get<1>( v_ ): E();
                            ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:561:41: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            throw_exception_from_error( variant2::unsafe_get<1>( v_ ), loc );
                                        ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
In file included from micro-webservice/src/main.cpp:33:
In file included from micro-webservice/src/httpworker.hpp:31:
In file included from micro-webservice/src/trip/router.hpp:30:
In file included from boost/include/boost/url.hpp:13:
In file included from boost/include/boost/url/grammar.hpp:19:
In file included from boost/include/boost/url/grammar/dec_octet_rule.hpp:14:
In file included from boost/include/boost/url/error_types.hpp:16:
boost/include/boost/system/result.hpp:561:41: error: no template named
      'unsafe_get' in namespace 'boost::variant2'; did you mean 'variant2::detail::unsafe_get'?
            throw_exception_from_error( variant2::unsafe_get<1>( v_ ), loc );
                                        ^~~~~~~~~~
/opt/local/include/boost/variant2/variant.hpp:372:88: note: 'variant2::detail::unsafe_get' declared
      here
template<std::size_t I, class... T> constexpr variant_alternative_t<I, variant<T...>>& unsafe_...
                                                                                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/micro-webservice.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/micro-webservice.dir/all] Error 2
make: *** [all] Error 2

Das lässt mich vollkommen ratlos zurück :-/

commented

Ich hab die Lösung gefunden 😃

Ich bin auf diesen Thread gestossen. Hier werden Apple clang version 11.0.0 (clang-1100.0.33.17) und die neuere Version Apple clang version 11.0.3 (clang-1103.0.32.59) erwähnt. Erstere als fehlerhaft, letztere als korrigiert .
Ich habe erstere 😞 (Big Sur, Xcode 11.3.1).

Big Sur updates zeigen mir aber keine Update-Möglichkeit für Xcode. Also habe ich Xcode 11.7 von der Apple Developer Download Seite direkt heruntergeladen und installiert. Mit dieser kommt nun auch AppleClang 11.0.3.11030032 mit. Und tatsächlich: der Neubau von boost und micro-webservice war jetzt damit erfolgreich 😆

Da ist aber noch etwas:
Ich hab das auch auf meinem Apple Silicon mit Ventura AppleClang 14 ausprobiert, also arm64. Boost und micro-webservice lassen sich damit bauen, jedoch meldete der Linker bei den micro-webservice, dass er den x86_64 build nicht gegen die Boost arm64 und gmp arm64 libraries linken konnte 😮 Ich habe im CMakeLists.txt nicht gefunden, was einen x86_64 link auf dem Apple Silicon forcieren würde ?

Nach etwas Recherche lies ich man sollte mit der cmake Option -DCMAKE_OSX_ARCHITECTURES="arm64" bauen also:

BOOST_ROOT=boost cmake --fresh -DCMAKE_OSX_ARCHITECTURES="arm64" ..

Wundert mich, dass man auf dem Arm das explizit angeben muß !?

Danke für die Rückmeldung.

Ich habe auch einen Mac mit Apple-Chip (MacBook Air M2), aber die Zielarchitektur musste ich beim Kompilieren noch nie angeben. Sehr, sehr seltsam.

commented

Nochmals kurze Rückmeldung:

Das Problem ist das VSCode binary, welches (aus meiner Migration vom alten iMac) ein Intel binary ware. Das zugehörige integrated terminal daher dir Architektur x86_64 (i386 sogar!) erkannte (wahrscheinlich durch das automatische Starten mittels Rosetta). Im externen Terminal wurde die Architektur als arm64 erkannt.

Nachdem ich nun das korrekte VSCode arm binary installiert habe funktioniert das Kompilieren, ohne zusätzliche Architektur Konfiguration.

Jetzt kann ich mich endlich dem C++ Projekt widmen 😄
Danke für Deine Unterstützung und den Artikel (und die zukünftigen)