How do I run policy based data structure in Mac?

  c++

Basically, I wanted to use g++-11 for gnu pbds.

I was running a file with g++-11 filename.cpp then it would show an error like

ld: warning: dylib (/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/libstdc++.dylib) was built for newer macOS version (11.3) than being linked (11.0)

But while running a file with /usr/local/bin/gcc-11 filename.cpp
then I got something like this

  "__ZNSirsERx", referenced from:
      _main in cclbdNhX.o
  "__ZNSolsEm", referenced from:
      _main in cclbdNhX.o
  "__ZNSt8ios_base15sync_with_stdioEb", referenced from:
      _main in cclbdNhX.o
  "__ZNSt8ios_base4InitC1Ev", referenced from:
      __Z41__static_initialization_and_destruction_0ii in cclbdNhX.o
  "__ZNSt8ios_base4InitD1Ev", referenced from:
      __Z41__static_initialization_and_destruction_0ii in cclbdNhX.o
  "__ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo", referenced from:
      _main in cclbdNhX.o
  "__ZSt17__throw_bad_allocv", referenced from:
      __ZN9__gnu_cxx13new_allocatorIN10__gnu_pbds6detail13rb_tree_node_ISt4pairIxxEmSaIcEEEE8allocateEmPKv in cclbdNhX.o
      __ZN9__gnu_cxx13new_allocatorIxE8allocateEmPKv in cclbdNhX.o
  "__ZSt20__throw_length_errorPKc", referenced from:
      __ZNSt6vectorIxSaIxEE17_S_check_init_lenEmRKS0_ in cclbdNhX.o
  "__ZSt28__throw_bad_array_new_lengthv", referenced from:
      __ZN9__gnu_cxx13new_allocatorIN10__gnu_pbds6detail13rb_tree_node_ISt4pairIxxEmSaIcEEEE8allocateEmPKv in cclbdNhX.o
      __ZN9__gnu_cxx13new_allocatorIxE8allocateEmPKv in cclbdNhX.o
  "__ZSt3cin", referenced from:
      _main in cclbdNhX.o
  "__ZSt4cout", referenced from:
      _main in cclbdNhX.o
  "__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c", referenced from:
      _main in cclbdNhX.o
  "__ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_", referenced from:
      _main in cclbdNhX.o
  "__ZTVN10__cxxabiv117__class_type_infoE", referenced from:
      __ZTIN10__gnu_pbds6detail13branch_policyINS0_30bin_search_tree_const_node_it_INS0_13rb_tree_node_ISt4pairIxxEmSaIcEEENS0_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_S6_EE in cclbdNhX.o
      __ZTIN10__gnu_pbds6detail15maybe_null_typeISt4pairIxxENS_9null_typeESaIcELb0EEE in cclbdNhX.o
      __ZTISt15binary_functionISt4pairIxxES1_bE in cclbdNhX.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "__ZTVN10__cxxabiv120__si_class_type_infoE", referenced from:
      __ZTIN10__gnu_pbds4treeISt4pairIxxENS_9null_typeESt4lessIS2_ENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEEE in cclbdNhX.o
      __ZTIN10__gnu_pbds12basic_branchISt4pairIxxENS_9null_typeENS_11rb_tree_tagENS_33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS6_13rb_tree_node_IS2_mSaIcEEENS6_25bin_search_tree_const_it_IPSA_S2_PS2_PKS2_RS2_RSE_Lb1ES9_EESI_S9_EESJ_St4lessIS2_ES9_EEN9__gnu_cxx8typelist4nodeINSO_5chainISL_NSQ_INS6_11tree_traitsIS2_S3_SL_S5_S4_S9_EENSO_9null_typeEEEEEEES9_EE in cclbdNhX.o
      __ZTIN10__gnu_pbds6detail11rb_tree_setISt4pairIxxENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_EE in cclbdNhX.o
      __ZTIN10__gnu_pbds6detail12types_traitsISt4pairIxxENS_9null_typeESaIcELb0EEE in cclbdNhX.o
      __ZTISt4lessISt4pairIxxEE in cclbdNhX.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "__ZTVN10__cxxabiv121__vmi_class_type_infoE", referenced from:
      __ZTIN10__gnu_pbds6detail19bin_search_tree_setISt4pairIxxENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_EE in cclbdNhX.o
      __ZTIN10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_ISt4pairIxxEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_EE in cclbdNhX.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "__ZdlPvm", referenced from:
      __ZN10__gnu_pbds6detail11rb_tree_setISt4pairIxxENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_ED0Ev in cclbdNhX.o
      __ZN10__gnu_pbds12basic_branchISt4pairIxxENS_9null_typeENS_11rb_tree_tagENS_33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS6_13rb_tree_node_IS2_mSaIcEEENS6_25bin_search_tree_const_it_IPSA_S2_PS2_PKS2_RS2_RSE_Lb1ES9_EESI_S9_EESJ_St4lessIS2_ES9_EEN9__gnu_cxx8typelist4nodeINSO_5chainISL_NSQ_INS6_11tree_traitsIS2_S3_SL_S5_S4_S9_EENSO_9null_typeEEEEEEES9_ED0Ev in cclbdNhX.o
      __ZN10__gnu_pbds6detail19bin_search_tree_setISt4pairIxxENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_ED0Ev in cclbdNhX.o
      __ZN9__gnu_cxx13new_allocatorIN10__gnu_pbds6detail13rb_tree_node_ISt4pairIxxEmSaIcEEEE10deallocateEPS7_m in cclbdNhX.o
      __ZN9__gnu_cxx13new_allocatorIxE10deallocateEPxm in cclbdNhX.o
      __ZN10__gnu_pbds4treeISt4pairIxxENS_9null_typeESt4lessIS2_ENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEED0Ev in cclbdNhX.o
  "__Znwm", referenced from:
      __ZN9__gnu_cxx13new_allocatorIN10__gnu_pbds6detail13rb_tree_node_ISt4pairIxxEmSaIcEEEE8allocateEmPKv in cclbdNhX.o
      __ZN9__gnu_cxx13new_allocatorIxE8allocateEmPKv in cclbdNhX.o
     (maybe you meant: __ZnwmPv)
  "___cxa_pure_virtual", referenced from:
      __ZTVN10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_ISt4pairIxxEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_EE in cclbdNhX.o
      __ZTVN10__gnu_pbds6detail13branch_policyINS0_30bin_search_tree_const_node_it_INS0_13rb_tree_node_ISt4pairIxxEmSaIcEEENS0_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_S6_EE in cclbdNhX.o
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in cclbdNhX.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Source: Windows Questions C++

LEAVE A COMMENT