ok things are better but i still get errors:
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main <
float128_example.cpp: In function 'int main()':
float128_example.cpp:186:20: error: call of overloaded 'exp(__float128)' is ambiguous
186 | float128 e1 = exp(1.Q); // Note argument to exp is type float128.
| ~~~^~~~~
In file included from /usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:45,
from /usr/local/Cellar/boost/1.76.0/include/boost/config/no_tr1/cmath.hpp:21,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/tools/config.hpp:19,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/cstdfloat/cstdfloat_types.hpp:18,
from /usr/local/Cellar/boost/1.76.0/include/boost/cstdfloat.hpp:18,
from float128_example.cpp:19:
/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/gcc/x86_64-apple-darwin20/11.1.0/include-fixed/math.h:376:15: note: candidate: 'double exp(double)'
376 | extern double exp(double);
| ^~~
In file included from /usr/local/Cellar/boost/1.76.0/include/boost/config/no_tr1/cmath.hpp:21,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/tools/config.hpp:19,
from /usr/local/Cellar/boost/1.76.0/include/boost/math/cstdfloat/cstdfloat_types.hpp:18,
from /usr/local/Cellar/boost/1.76.0/include/boost/cstdfloat.hpp:18,
from float128_example.cpp:19:
/usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:226:3: note: candidate: 'constexpr long double std::exp(long double)'
226 | exp(long double __x)
| ^~~
/usr/local/Cellar/gcc/11.1.0_1/include/c++/11.1.0/cmath:222:3: note: candidate: 'constexpr float std::exp(float)'
222 | exp(float __x)
| ^~~
The terminal process "zsh '-c', 'g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' float128_example.cpp -o main'" terminated with exit code: 1.
Compiling the following example:
#include <iomanip>
#include <iostream>
#include
Executing task: g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main <
Undefined symbols for architecture x86_64:
"__Z17quadmath_snprintfPcmPKcz", referenced from:
__ZNK5boost14multiprecision8backends16float128_backend3strB5cxx11ElSt13_Ios_Fmtflags in ccGxvsSR.o
"__Z4logqg", referenced from:
__ZN5boost14multiprecision8backends8eval_logERNS1_16float128_backendERKS2_ in ccGxvsSR.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
The terminal process "zsh '-c', 'g++-11 -g -I/usr/local/Cellar/boost/1.76.0/include/ -I/usr/local/include/ -L/usr/local/Cellar/boost/1.76.0/lib/ -L/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/ -L/usr/local/Cellar/gmp/6.2.1/lib/ -L/usr/local/Cellar/mpfr/4.1.0/lib/ -std=gnu++20 -lmpfr -lgmp -lquadmath -lboost_system -lboost_filesystem '-fext-numeric-literals' fs_main.cpp -o main'" terminated with exit code: 1.
Note that if I compile the following example without using Boost I have no linking errors with quadmath:
#include
Il giorno 21 lug 2021, alle ore 13:08, John Maddock via Boost-users
ha scritto: On 20/07/2021 18:44, Stefano Gragnani via Boost-users wrote:
Hi,
I'm having trouble compiling code that contains float128 data type. I'm using MacOS Big Sur 11.4. Compiler: gcc version 11.1.0 (Homebrew GCC 11.1.0_1)
I have no other problems with Boost, the only problem is when I use float128.
Please note that I have no problem compiling using libquadmath without using Boost using the __float128 data type.
I use Visual Studio Code:
You can manually fix this by defining BOOST_HAS_FLOAT128 on the command line. However, you may still hit other errors as __float128 and quadmath.h aren't really fully supported in ISO C++ mode. The correct fix is to use -std=gnu++20, and then GNU extensions including __float128 are turned on.
HTH, John.
-- 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