pothosware / SoapyPlutoSDR

Soapy SDR plugin for PlutoSDR
https://github.com/pothosware/SoapyPlutoSDR/wiki
GNU Lesser General Public License v2.1
58 stars 22 forks source link

Unable to compile with recent change #3

Closed darsor closed 5 years ago

darsor commented 5 years ago

I get the following compilation error after commit fb6fbd2:

/home/darsor/build/aur/soapyplutosdr-git/src/soapyplutosdr/PlutoSDR_Registation.cpp: In function ‘std::vector<std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > find_PlutoSDR(const Kwargs&)’:
/home/darsor/build/aur/soapyplutosdr-git/src/soapyplutosdr/PlutoSDR_Registation.cpp:32:43: error: cannot convert ‘const mapped_type’ {aka ‘const std::__cxx11::basic_string<char>’} to ‘const char*’
   ctx = iio_create_network_context(args.at("hostname"));
                                    ~~~~~~~^~~~~~~~~~~~
In file included from /home/darsor/build/aur/soapyplutosdr-git/src/soapyplutosdr/SoapyPlutoSDR.hpp:1,
                 from /home/darsor/build/aur/soapyplutosdr-git/src/soapyplutosdr/PlutoSDR_Registation.cpp:1:
/usr/include/iio.h:338:67: note:   initializing argument 1 of ‘iio_context* iio_create_network_context(const char*)’
 __api struct iio_context * iio_create_network_context(const char *host);
                                                       ~~~~~~~~~~~~^~~~

I was able to fix it by changing line 32 in PlutoSDR_Registration.cpp to

ctx = iio_create_network_context(args.at("hostname").c_str());