Open Fojtik opened 3 months ago
This is just a script code fragment that checks neccessity of -fpermisive
####### Check default arg in friend function ######
default_arg_flaw='no'
AC_MSG_CHECKING(whether friend function could have a default arg )
AC_LANG(C++)
AC_TRY_COMPILE(
[
class MyClassNo1 {
public: MyClassNo1(unsigned len);
friend int MyFriendFunc(const MyClassNo1 & s, char c='1');
};
],
[],
default_arg_flaw='no',
default_arg_flaw='yes')
if test "$default_arg_flaw" == 'yes'
then
CXXFLAGS="$CXXFLAGS -fpermissive"
echo "no - fix -fpermissive used"
else
echo "yes"
fi
I would recommend to use autoconf and configure script. Configure script could check all command line optional options.
Option "-fwritable-strings" is not supported from GCC4.
Please note that I have most of these issues solved in my free of charge program https://ftsoft.com.cz/wp2latex/wp2latex.htm I can help you to fix it.
after removing this option I see another error:
And after adding -fpermissive I see this problem:
Please note that "explicit" is a C++ keyword, you must not use it for anything.
After fixing this I have found that -ansi switch is unwanted, see reason https://stackoverflow.com/questions/2223541/why-cant-i-use-style-comments-in-my-c-code
Seems to be mission impossible to get this compilled: