Hi,

you are right probably some gcc / clang mix was there, now i recompiled boost 
with gcc-11 and the linking errors are gone but now i get errors at runtime.

./bootstrap.sh --prefix=/usr/local/boost-1.76.0_gcc-11_libs
In project-config.jam:
#if ! clang in [ feature.values <toolset> ]
#{
#    using clang ; 
#}

#project : default-build <toolset>clang ;

using gcc : 11.1.0 : /usr/local/Cellar/gcc/11.1.0_1/bin/g++-11 ;


and then:
sudo ./b2 cxxflags=-std=gnu++20 install
export 
DYLD_LIBRARY_PATH=/usr/local/boost-1.76.0_gcc-11_libs/lib:$DYLD_LIBRARY_PATH
and at runtime I get:
dyld: Symbol not found: __ZN5boost15program_options3argB5cxx11E
  Referenced from: 
/Users/stegra/Projects/VSCode/BoostCookbook/./Chapter01/01_A_program_options_base/main
  Expected in: /usr/local/lib/libboost_program_options.dylib
 in 
/Users/stegra/Projects/VSCode/BoostCookbook/./Chapter01/01_A_program_options_base/main
Thanks
Stefano
> Il giorno 24 lug 2021, alle ore 12:33, John Maddock via Boost-users 
> <boost-users@lists.boost.org> ha scritto:
> 
> On 23/07/2021 07:57, Stefano Gragnani via Boost-users wrote:
>> The development system is:
>> MacBook Pro Intel i9
>> MacOS  Big Sur 11.4
>> gcc version 11.1.0 (Homebrew GCC 11.1.0_1)
>> clang version 12.0.0
>> 
>> I'm having trouble compiling some examples from the book 'Boost C ++ 
>> Application Development Cookbook’.
>> The problem occurs *only* *with g ++,* *with clang there is no error.*
>> Mistakes only occur when linking to -lboost_program_options, -lboost_system 
>> and -lboost_filesystem, with any other library (eg -lboost_chrono) 
>> everything is fine.
> 
> Did you compile the libraries with g++ or are they clang compiled?  I would 
> expect that mixing the 2 would cause issues.
> 
> 
> 
> -- 
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> _______________________________________________
> Boost-users mailing list
> Boost-users@lists.boost.org
> https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users

Reply via email to