v0l / radio_tool

Radio firmware tool
https://discord.gg/V596cyatmv
GNU General Public License v3.0
74 stars 17 forks source link

Build fails on macOS / under clang #3

Closed supersat closed 2 years ago

supersat commented 3 years ago

There are a few build errors when attempting to compile radio_tool on macOS with the default AppleClang compiler. Here's a typical error:

In file included from /Users/supersat/Projects/radio_tool/include/radio_tool/radio/radio_factory.hpp:20:
In file included from /Users/supersat/Projects/radio_tool/include/radio_tool/radio/radio.hpp:20:
In file included from /Users/supersat/Projects/radio_tool/include/radio_tool/dfu/dfu.hpp:23:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream:174:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:778:50: error: implicit instantiation of undefined template 'std::__1::ctype<char16_t>'
    return use_facet<ctype<char_type> >(getloc()).widen(__c);
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:840:29: note: in instantiation of member function 'std::__1::basic_ios<char16_t,
      std::__1::char_traits<char16_t> >::widen' requested here
                *__p = __os.widen(*__strn);
                            ^
/Users/supersat/Projects/radio_tool/include/radio_tool/codeplug/rdt_general.hpp:76:17: note: in instantiation of function template specialization
      'std::__1::operator<<<char16_t, std::__1::char_traits<char16_t> >' requested here
                << "Intro 1: " << intro_line1 << std::endl
                ^

https://lists.apple.com/archives/xcode-users/2012/Jul/msg00092.html suggests that stream classes are only defined to work with char and wchar_t, so I think gcc is just more forgiving in this instance, and any code that uses std::basic_stringstream should be rewritten.

rogerclarkmelbourne commented 2 years ago

Looks like this project is no longer maintained, but I just tried to make this tool on OSX BigSur, and cmake failed due to some unsupported package name :-(

v0l commented 2 years ago

I dont own a mac anymore so i cant test this

rogerclarkmelbourne commented 2 years ago

@v0l

OK

I only wanted to try the Mac version because of the dump bootloader feature, but I don't think it is likely to work even on the mac for the latest TYT firmware

v0l commented 2 years ago

It DID work when I first added it. Its based on your script

v0l commented 2 years ago

Fixed by: 07da74b0a1d5d0da63ca9acc6df65dd5df928f6e

v0l commented 2 years ago

https://github.com/v0l/radio_tool/actions/runs/1387087510

Added github action for OSX builds, see artifacts section with .dmg