Compile ERROR c++ programm in ubuntu and raspberry pi

I got a major problem with compiling a c++ programm on a raspberry pi.

My Programm compiles just fine on ubuntu with the same version ov boost and g++ as i am using on the pi. the pi is using wheezy.
Somehow i can't compile it on the pi. Help is much much apprechiated.


In member function ‘void serialCommunication::open(const string&, unsigned int, boost::asio::serial_port_base::parity, boost::asio::serial_port_base::character_size, boost::asio::serial_port_base::flow_control, boost::asio::serial_port_base::stop_bits)’:
/home/pi/GuardServer/src/serialCommunication.cpp:69:109: error: no matches converting function ‘run’ to type ‘long unsigned int (class boost::asio::io_service::*)()’
In file included from /usr/include/boost/asio/io_service.hpp:769:0,
                 from /usr/include/boost/asio/basic_io_object.hpp:19,
                 from /usr/include/boost/asio/basic_socket.hpp:19,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /usr/include/boost/asio.hpp:20,
                 from /home/pi/GuardServer/src/serialCommunication.h:14,
                 from /home/pi/GuardServer/src/serialCommunication.cpp:1:
/usr/include/boost/asio/impl/io_service.ipp:64:13: error: candidates are: std::size_t boost::asio::io_service::run(boost::system::error_code&)
/usr/include/boost/asio/impl/io_service.ipp:56:13: error:                 std::size_t boost::asio::io_service::run()


As far as I am able to Interpret the above error the error happens somewhere in the underneath code snipped.

1
2
3
4
5
6
    boost::thread t(boost::bind((unsigned long int (boost::asio::io_service::*)())&boost::asio::io_service::run, &pimpl->io));

    pimpl->backgroundThread.swap(t);
    setErrorStatus(false);//If we get here, no error
    pimpl->open=true; //Port is now open


Thanks a lot in advance

Best regards thomas
Last edited on
closed account (Dy7SLyTq)
try replacing unsigned long int with run.
Thanks man priliant thought. I should have seen that long ago.
Thanks a lot
closed account (Dy7SLyTq)
np
I got there another error i just can't figure out what to do? I was able to compile my code but when i try to create a executable file i get the following error. (boost was compiled at the raspberry pi)



g++ -L/usr/lib -o "GuardServer" /home/pi/GuardServer/src/CSmtp.o /home/pi/GuardServer/src/GuardServer.o /home/pi/GuardServer/src/base64.o /home/pi/GuardServer/src/md5.o /home/pi/GuardServer/src/serialCommunication.o -lpthread -lboost_thread -lboost_system -lrt -lboost_date_time -lmysqlcppconn -lssl
`.LTHUNK24' referenced in section `.text._ZN5boost16exception_detail19error_info_injectorINS_21thread_resource_errorEED1Ev[boost::exception_detail::error_info_injector<boost::thread_resource_error>::~error_info_injector()]' of /usr/lib/libboost_thread.a(thread.o): defined in discarded section `.text._ZN5boost16exception_detail19error_info_injectorINS_21thread_resource_errorEED2Ev[_ZN5boost16exception_detail19error_info_injectorINS_21thread_resource_errorEED5Ev]' of /usr/lib/libboost_thread.a(thread.o)
`.LTHUNK30' referenced in section `.text._ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED1Ev[boost::exception_detail::error_info_injector<boost::lock_error>::~error_info_injector()]' of /usr/lib/libboost_thread.a(thread.o): defined in discarded section `.text._ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED2Ev[_ZN5boost16exception_detail19error_info_injectorINS_10lock_errorEED5Ev]' of /usr/lib/libboost_thread.a(thread.o)
`.LTHUNK32' referenced in section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED1Ev[boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >::~clone_impl()]' of /usr/lib/libboost_thread.a(thread.o): defined in discarded section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED2Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED5Ev]' of /usr/lib/libboost_thread.a(thread.o)
`.LTHUNK33' referenced in section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED1Ev[boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >::~clone_impl()]' of /usr/lib/libboost_thread.a(thread.o): defined in discarded section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED2Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_10lock_errorEEEED5Ev]' of /usr/lib/libboost_thread.a(thread.o)
`.LTHUNK26' referenced in section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEED1Ev[boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::thread_resource_error> >::~clone_impl()]' of /usr/lib/libboost_thread.a(thread.o): defined in discarded section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEED2Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEED5Ev]' of /usr/lib/libboost_thread.a(thread.o)
`.LTHUNK27' referenced in section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEED1Ev[boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::thread_resource_error> >::~clone_impl()]' of /usr/lib/libboost_thread.a(thread.o): defined in discarded section `.text._ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEED2Ev[_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_21thread_resource_errorEEEED5Ev]' of /usr/lib/libboost_thread.a(thread.o)
collect2: ld returned 1 exit status



thanks again for your time and your help.

best regards thomas
closed account (Dy7SLyTq)
what commands are you running to compile and create exes?
To compile


g++ -I/usr/include/ -I/usr/include/openssl -I/usr/include/boost -O0 -g3 -Wall -c "/home/pi/GuardServer/src/GuardServer.cpp"

For Every class or course.

To create exes

g++ -L/usr/lib -o "GuardServer" /home/pi/GuardServer/src/CSmtp.o /home/pi/GuardServer/src/GuardServer.o /home/pi/GuardServer/src/base64.o /home/pi/GuardServer/src/md5.o /home/pi/GuardServer/src/serialCommunication.o -lpthread -lboost_thread -lboost_system -lrt -lboost_date_time -lmysqlcppconn -lssl


Thanks for your time
Last edited on
I was finally able to compile it but still have troubles running it. Anybody seen this error: Below the backtrace from gdb output.


(gdb) run
Starting program: /home/pi/GuardServer/src/GuardServer 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0xb6eaa5e0 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) bt
#0  0xb6eaa5e0 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
Cannot access memory at address 0x0
#1  0xb6ea6fc4 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#2  0xb6fe8254 in ?? () from /lib/ld-linux-armhf.so.3
#3  0xbefff97a in ?? ()
#4  0xbefff97a in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) continue
Continuing.

Program received signal SIGILL, Illegal instruction.
0xb6eaa5e8 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
(gdb) bt
#0  0xb6eaa5e8 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
Cannot access memory at address 0x0
#1  0xb6ea6fe4 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0
#2  0xb6fe8254 in ?? () from /lib/ld-linux-armhf.so.3
#3  0xbefff97a in ?? ()
#4  0xbefff97a in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) continue
Continuing.

Program received signal SIGILL, Illegal instruction.
0xb6dd9fd8 in ?? () from /usr/lib/libmysqlcppconn.so.7
(gdb) bt
#0  0xb6dd9fd8 in ?? () from /usr/lib/libmysqlcppconn.so.7
#1  0xb6dd4a3a in _init () from /usr/lib/libmysqlcppconn.so.7
#2  0xb6fe8210 in ?? () from /lib/ld-linux-armhf.so.3
#3  0xbefff97a in ?? ()
#4  0xbefff97a in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) continue
Continuing.

Program terminated with signal SIGILL, Illegal instruction.
The program no longer exists.
(gdb) bt
No stack.


I am really starting to get some pressure on me having this thing run on the pi. So help is really much welcome. Thanks again guys for your time

best regards Thomas
closed account (Dy7SLyTq)
im sorry... i dont know how raspberry pi works
Topic archived. No new replies allowed.