Free Ground Shipping on all orders over $100 (US Only)
login   |   Register

Welcome Forums General Error compiling files

This topic contains 1 reply, has 2 voices, and was last updated by belpatca belpatca 5 months, 3 weeks ago.

  • Author
    Posts
  • #8105
    Jim
    Jim
    Participant

    I am using a Raspberry Pi 3, Model B, Rev1.2. I had my gateway running along with temperature sensors and everything was working fine running with an ethernet cable but I want to be able to run wireless and my wireless wouldn’t function. After hours of troubleshooting I decided to start over with the Pi so I reformatted and installed OS at which time I noticed that the Pi was now running Stretch and previously it was running Jessie. When I go to compile the basic files I get the results shown below. I am definitely not a programmer so I am hoping someone may be able to tell me what is causing this error and what I might be able to do to fix it.
    Thanks,
    Jim
    root@Pizza:/home/pi/Desktop/Tarts/Tarts_RaspberryPi_V12_120317# sudo ./build all
    [Uninstalling Tarts]
    [Cleaning all example object and executable files]
    [Tarts library files are not detected — Loading library]</str
    ./build: 35: test: /usr/local/lib/libTarts.so: unexpected operator
    [Making Example Applications Now…]
    [Compiling] TartsBasic.cpp
    [Compiling] TartsSniffer.cpp
    [Compiling] TartsAdvanced.cpp
    [Compiling] TartsBasicControl.cpp
    [Compiling] TartsPersistence.cpp
    TartsPersistence.cpp: In function ‘int findDevice(const char*)’:
    TartsPersistence.cpp:180:13: error: no match for ‘operator!=’ (operand types are ‘std::ifstream {aka std::basic_ifstream<char>}’ and ‘int’)
    if(infile != NULL){
    ^
    TartsPersistence.cpp:180:13: note: candidate: operator!=(int, int) <built-in>
    TartsPersistence.cpp:180:13: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘int’
    In file included from /usr/include/c++/6/bits/locale_facets.h:48:0,
    from /usr/include/c++/6/bits/basic_ios.h:37,
    from /usr/include/c++/6/ios:44,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/streambuf_iterator.h:210:5: note: candidate: template<class _CharT, class _Traits> bool std::operator!=(const std::istreambuf_iterator<_CharT, _Traits>&, const std::istreambuf_iterator<_CharT, _Traits>&)
    operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
    ^~~~~~~~
    /usr/include/c++/6/bits/streambuf_iterator.h:210:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::istreambuf_iterator<_CharT, _Traits>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
    from /usr/include/c++/6/ios:42,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/system_error:323:3: note: candidate: bool std::operator!=(const std::error_condition&, const std::error_condition&)
    operator!=(const error_condition& __lhs,
    ^~~~~~~~
    /usr/include/c++/6/system_error:323:3: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘const std::error_condition&’
    /usr/include/c++/6/system_error:319:3: note: candidate: bool std::operator!=(const std::error_condition&, const std::error_code&)
    operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept
    ^~~~~~~~
    /usr/include/c++/6/system_error:319:3: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘const std::error_condition&’
    /usr/include/c++/6/system_error:315:3: note: candidate: bool std::operator!=(const std::error_code&, const std::error_condition&)
    operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept
    ^~~~~~~~
    /usr/include/c++/6/system_error:315:3: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘const std::error_code&’
    /usr/include/c++/6/system_error:311:3: note: candidate: bool std::operator!=(const std::error_code&, const std::error_code&)
    operator!=(const error_code& __lhs, const error_code& __rhs) noexcept
    ^~~~~~~~
    /usr/include/c++/6/system_error:311:3: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream<char>}’ to ‘const std::error_code&’
    In file included from /usr/include/c++/6/string:52:0,
    from /usr/include/c++/6/bits/locale_classes.h:40,
    from /usr/include/c++/6/bits/ios_base.h:41,
    from /usr/include/c++/6/ios:42,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/basic_string.h:5137:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
    ^~~~~~~~
    /usr/include/c++/6/bits/basic_string.h:5137:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/string:52:0,
    from /usr/include/c++/6/bits/locale_classes.h:40,
    from /usr/include/c++/6/bits/ios_base.h:41,
    from /usr/include/c++/6/ios:42,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/basic_string.h:5125:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
    operator!=(const _CharT* __lhs,
    ^~~~~~~~
    /usr/include/c++/6/bits/basic_string.h:5125:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: mismatched types ‘const _CharT*’ and ‘std::basic_ifstream<char>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/string:52:0,
    from /usr/include/c++/6/bits/locale_classes.h:40,
    from /usr/include/c++/6/bits/ios_base.h:41,
    from /usr/include/c++/6/ios:42,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/basic_string.h:5112:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
    operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
    ^~~~~~~~
    /usr/include/c++/6/bits/basic_string.h:5112:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/string:41:0,
    from /usr/include/c++/6/bits/locale_classes.h:40,
    from /usr/include/c++/6/bits/ios_base.h:41,
    from /usr/include/c++/6/ios:42,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/allocator.h:164:5: note: candidate: template<class _Tp> bool std::operator!=(const std::allocator<_CharT>&, const std::allocator<_CharT>&)
    operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
    ^~~~~~~~
    /usr/include/c++/6/bits/allocator.h:164:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::allocator<_CharT>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/string:41:0,
    from /usr/include/c++/6/bits/locale_classes.h:40,
    from /usr/include/c++/6/bits/ios_base.h:41,
    from /usr/include/c++/6/ios:42,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/allocator.h:158:5: note: candidate: template<class _T1, class _T2> bool std::operator!=(const std::allocator<_CharT>&, const std::allocator<_T2>&)
    operator!=(const allocator<_T1>&, const allocator<_T2>&)
    ^~~~~~~~
    /usr/include/c++/6/bits/allocator.h:158:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::allocator<_CharT>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
    from /usr/include/c++/6/bits/char_traits.h:39,
    from /usr/include/c++/6/ios:40,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/stl_iterator.h:1131:5: note: candidate: template<class _Iterator> bool std::operator!=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
    operator!=(const move_iterator<_Iterator>& __x,
    ^~~~~~~~
    /usr/include/c++/6/bits/stl_iterator.h:1131:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::move_iterator<_IteratorL>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
    from /usr/include/c++/6/bits/char_traits.h:39,
    from /usr/include/c++/6/ios:40,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/stl_iterator.h:1125:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator!=(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
    operator!=(const move_iterator<_IteratorL>& __x,
    ^~~~~~~~
    /usr/include/c++/6/bits/stl_iterator.h:1125:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::move_iterator<_IteratorL>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
    from /usr/include/c++/6/bits/char_traits.h:39,
    from /usr/include/c++/6/ios:40,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/stl_iterator.h:361:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator!=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
    operator!=(const reverse_iterator<_IteratorL>& __x,
    ^~~~~~~~
    /usr/include/c++/6/bits/stl_iterator.h:361:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
    from /usr/include/c++/6/bits/char_traits.h:39,
    from /usr/include/c++/6/ios:40,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/stl_iterator.h:304:5: note: candidate: template<class _Iterator> bool std::operator!=(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
    operator!=(const reverse_iterator<_Iterator>& __x,
    ^~~~~~~~
    /usr/include/c++/6/bits/stl_iterator.h:304:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
    from /usr/include/c++/6/bits/char_traits.h:39,
    from /usr/include/c++/6/ios:40,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/stl_pair.h:448:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator!=(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
    operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    ^~~~~~~~
    /usr/include/c++/6/bits/stl_pair.h:448:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::pair<_T1, _T2>’
    if(infile != NULL){
    ^
    In file included from /usr/include/c++/6/iosfwd:40:0,
    from /usr/include/c++/6/ios:38,
    from /usr/include/c++/6/istream:38,
    from /usr/include/c++/6/fstream:38,
    from ./TartsPlatform.h:160,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    /usr/include/c++/6/bits/postypes.h:221:5: note: candidate: template<class _StateT> bool std::operator!=(const std::fpos<_StateT>&, const std::fpos<_StateT>&)
    operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
    ^~~~~~~~
    /usr/include/c++/6/bits/postypes.h:221:5: note: template argument deduction/substitution failed:
    In file included from /usr/include/arm-linux-gnueabihf/bits/sigcontext.h:31:0,
    from /usr/include/signal.h:306,
    from /usr/include/arm-linux-gnueabihf/sys/wait.h:29,
    from ./TartsPlatform.h:177,
    from ./Tarts.h:25,
    from TartsPersistence.cpp:33:
    TartsPersistence.cpp:180:16: note: ‘std::ifstream {aka std::basic_ifstream<char>}’ is not derived from ‘const std::fpos<_StateT>’
    if(infile != NULL){
    ^
    TartsPersistence.cpp: In function ‘void OnSenMsgEv(SensorMessage*)’:
    TartsPersistence.cpp:323:40: warning: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
    strncpy(thisSensorID, msg->ID, sizeof(msg->ID));
    ^
    Makefile:52: recipe for target ‘TartsPersistence.o’ failed
    make: *** [TartsPersistence.o] Error 1

  • #9581
    belpatca
    belpatca
    Participant

    Hi Jim,

    Some of the example code uses poorly written c++. I got TartsPersistence.cpp to compile by changing line 180 from
    if(infile != NULL){
    to
    if(! infile.fail()) {

    Good luck!

You must be logged in to reply to this topic.

Support
Contact Us!

Your Name (required)

Your Email (required)

Subject

Your Message

Enter this code below: captcha