_GLIBCXX_USE_C99_MATH_FUNCS replaced _GLIBCXX_USE_C99_MATH_TR1 in gcc 14.1.0, see https://github.com/gcc-mirror/gcc/commit/1f378f6dd33ad5067a437d1c456979f8662020d6
Formally I suppose it would be most correct to select which one to use with // Avoid cmath missing function decl. #if.__GNUC__ < 14 || (__GNUC__ == 14 && __GNUC_MINOR__ < 1) #undef _GLIBCXX_USE_C99_MATH_TR1 #else #undef _GLIBCXX_USE_C99_MATH_FUNCS #endif But it’s harmless to just undef both of them. Do you want to submit a PR so you get credit? Regards, John Ralls > On Aug 14, 2024, at 23:50, Hai Liang Wang <[email protected]> wrote: > > So far, I know more about the problem, but haven't find a solution yet. > > `cmath:2106:11: error: 'copysign' has not been declared in '::'`, this link > explain the error cause - > https://stackoverflow.com/questions/1216878/cmath-functions-generating-compiler-error > > And in, `gnucash\stable\src\gnucash-git\gnucash\gnucash-core-app.hpp`, it > has > > *#ifdef __MINGW32__* > *#undef _GLIBCXX_USE_C99_MATH_TR1 // Avoid cmath missing function decl.* > *#endif* > > What happens in my machine, is that cmath's functions are missing, like > *copysign.* > > So, how to get rid of it? > Need help, thanks. > > Cheers. > Hai Liang W. > > > On Thu, Aug 15, 2024 at 11:32 AM Hai Liang Wang <[email protected]> > wrote: > >> hi, folks >> >> Run script `TARGET=gnucash-stable jhbuild -f jhbuildrc build` to build >> windows installer, come to an error - >> >> *gnucash.dir/gnucash-core-app.cpp.obj -c >> C:/gcdev64/gnucash/stable/src/gnucash-git/gnucash/gnucash-core-app.cpp* >> *In file included from >> C:/gcdev64/msys2/mingw32/include/boost/core/cmath.hpp:19,* >> * from >> C:/gcdev64/msys2/mingw32/include/boost/lexical_cast/detail/converter_numeric.hpp:26,* >> * from >> C:/gcdev64/msys2/mingw32/include/boost/lexical_cast/try_lexical_convert.hpp:31,* >> * from >> C:/gcdev64/msys2/mingw32/include/boost/lexical_cast.hpp:33,* >> * from >> C:/gcdev64/msys2/mingw32/include/boost/program_options/value_semantic.hpp:14,* >> * from >> C:/gcdev64/msys2/mingw32/include/boost/program_options/options_description.hpp:13,* >> * from >> C:/gcdev64/msys2/mingw32/include/boost/program_options.hpp:15,* >> * from >> C:/gcdev64/gnucash/stable/src/gnucash-git/gnucash/gnucash-core-app.hpp:31,* >> * from >> C:/gcdev64/gnucash/stable/src/gnucash-git/gnucash/gnucash-core-app.cpp:32:* >> *C:/gcdev64/msys2/mingw32/include/c++/14.2.0/cmath:2106:11: error: >> 'copysign' has not been declared in '::'* >> * 2106 | using ::copysign;* >> * | ^~~~~~~~* >> *[124/131] Building CXX object >> gnucash/CMakeFiles/gnucash.dir/gnucash.cpp.obj* >> *FAILED: gnucash/CMakeFiles/gnucash.dir/gnucash.cpp.obj * >> >> How to fix it? >> Any suggestion is apprecaited. >> >> Other version info: >> >> *# g++ --version* >> g++.exe (Rev1, Built by MSYS2 project) 14.2.0 >> Copyright (C) 2024 Free Software Foundation, Inc. >> This is free software; see the source for copying conditions. There is NO >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. >> >> *# pacman -Q|grep c++* >> mingw-w64-i686-libc++ 18.1.8-1 >> >> *# pacman -Q|grep boost* >> mingw-w64-i686-boost 1.85.0-4 >> >> >> Attached the full log. >> >> Cheers. >> Hai Liang W. >> > _______________________________________________ > gnucash-user mailing list > [email protected] > To update your subscription preferences or to unsubscribe: > https://lists.gnucash.org/mailman/listinfo/gnucash-user > ----- > Please remember to CC this list on all your replies. > You can do this by using Reply-To-List or Reply-All. _______________________________________________ gnucash-user mailing list [email protected] To update your subscription preferences or to unsubscribe: https://lists.gnucash.org/mailman/listinfo/gnucash-user ----- Please remember to CC this list on all your replies. You can do this by using Reply-To-List or Reply-All.
