All of the following is on a Raspberry Pi 3 with Qt 5.3.2 (GCC 4.9.2, 32 bit).

MainWindow.h
Qt Code:
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3.  
  4. #include <QMainWindow>
  5. #include <QtSerialPort/qserialportinfo.h>
  6. #include <QtSerialPort/qserialport.h>
  7. #include <QObject>
  8. #include <QtCore/QCoreApplication>
  9. #include <QDebug>
  10. #include <QList>
  11.  
  12.  
  13.  
  14. namespace Ui {
  15. class MainWindow;
  16. }
  17.  
  18. class MainWindow : public QMainWindow
  19. {
  20. Q_OBJECT
  21.  
  22. public:
  23. explicit MainWindow(QWidget *parent = 0);
  24.  
  25.  
  26. bool zaber_is_available;
  27. ~MainWindow();
  28.  
  29. private slots:
  30.  
  31.  
  32.  
  33. void on_Calibration_25mm_stage_move_button_clicked(int position);
  34.  
  35. void on_Calibration_25mm_stage_home_button_clicked();
  36.  
  37. void on_Calibration_25mm_stage_out_button_clicked();
  38.  
  39. void on_Calibration_300mm_stage_move_button_clicked(int position);
  40.  
  41. void on_Calibration_300mm_stage_home_button_clicked();
  42.  
  43. void on_Shot_tab_25mm_stage_move_button_clicked(int position);
  44.  
  45. void on_Shot_tab_25mm_stage_home_button_clicked();
  46.  
  47. void on_Shot_tab_25mm_stage_out_button_clicked();
  48.  
  49. void CommZaber(QString);
  50.  
  51. void on_Calibration_25mm_slider_sliderMoved(int position);
  52.  
  53. void on_Calibration_300mm_slider_sliderMoved(int position);
  54.  
  55. void on_Shot_tab_25mm_slider_sliderMoved(int position);
  56.  
  57. void on_Shot_tab_25mm_spinbox_valueChanged(int arg1);
  58.  
  59. void on_Calibration_300mm_spinbox_valueChanged(int arg1);
  60.  
  61. void on_Calibration_25mm_spinbox_valueChanged(int arg1);
  62.  
  63.  
  64. private:
  65. Ui::MainWindow *ui;
  66. QSerialPortInfo *serialPortInfo;
  67. QSerialPort *zaber;
  68.  
  69.  
  70. static const quint16 zaber_vendor_id = 0403;
  71. static const quint16 zaber_product_id = 6001;
  72.  
  73. };
  74.  
  75. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

main.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3. #include <QPushButton>
  4. #include <QSpinBox>
  5. #include <QSlider>
  6.  
  7. int main(int argc, char *argv[])
  8. {
  9. QApplication a(argc, argv);
  10. MainWindow w;
  11. w.setWindowTitle("Compact 6 Radiometer Control Unit");
  12. w.show();
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. return a.exec();
  20. }
To copy to clipboard, switch view to plain text mode 

MainWindow.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QtSerialPort/qserialport.h>
  4. #include <QtSerialPort/qserialportinfo.h>
  5. #include <QObject>
  6. #include <QList>
  7. #include <QDebug>
  8. #include <QString>
  9. #include <QWidget>
  10. #include "qmath.h"
  11. #include <QIODevice>
  12.  
  13. QT_USE_NAMESPACE
  14.  
  15. char Reply_Bytes[6] ={0};
  16. qint64 maxSize = 6;
  17. int value[4];
  18. int value2[4];
  19. char position_command[6] = {0};
  20. double new_value;
  21. float conversion;
  22. float distance;
  23. const double global_x = pow(256,3);
  24. const double global_y = pow(256,2);
  25. const double global_z = pow(256,4);
  26. float input_position;
  27. int Cmd_Byte_6 = 0;
  28. int Cmd_Byte_5 = 0;
  29. int Cmd_Byte_4 = 0;
  30. int Cmd_Byte_3 = 0;
  31.  
  32. MainWindow::MainWindow(QWidget *parent) :
  33. QMainWindow(parent),
  34. ui(new Ui::MainWindow)
  35. {
  36. ui->setupUi(this);
  37.  
  38. zaber_is_available = false;
  39.  
  40. qDebug() <<"Number of ports: "<<QSerialPortInfo::availablePorts();
  41.  
  42. foreach(const QSerialPortInfo &serialPortInfo, QSerialPortInfo::availablePorts())
  43. {
  44. qDebug()<< "Name: " << serialPortInfo.portName();
  45. qDebug()<< "Description: "<< serialPortInfo.description();
  46. qDebug()<< "Manufacturer: " << serialPortInfo.manufacturer();
  47. if(serialPortInfo.hasVendorIdentifier() && serialPortInfo.hasProductIdentifier())
  48. {
  49. qDebug() << "Has VendorID and ProductID:" << serialPortInfo.hasVendorIdentifier() <<
  50. "and" << serialPortInfo.hasVendorIdentifier();
  51. if(serialPortInfo.vendorIdentifier() == zaber_vendor_id)
  52. {
  53. qDebug() << "Vendor: " << serialPortInfo.vendorIdentifier();
  54. if(serialPortInfo.productIdentifier() == zaber_product_id)
  55. {
  56. qDebug() << "Product: " << serialPortInfo.productIdentifier();
  57. zaber = new QSerialPort;
  58. zaber_is_available = true;
  59. }
  60. }
  61. }
  62. }
  63.  
  64. //code removed as QDebug does not show in it and it is too long.
  65.  
  66. void MainWindow::CommZaber(QString command)
  67. {
  68. if(zaber->isWritable()){
  69. zaber->write(command.toStdString().c_str());
  70. }
  71. else{
  72. qDebug() << "Couldn't Write to Serial";
  73. }
  74.  
  75. }
To copy to clipboard, switch view to plain text mode 

The error I get is as stated in the post title. The pointer for the error leads me to the library, as if the error was in the library.

I have tried adding the following to my header file to fix the issue but it did not work.
Qt Code:
  1. class DebugClass : public QObject
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit DebugClass(QObject *parent = 0);
  6. friend QDebug operator<< (QDebug dbg, const DebugClass &info){
  7. dbg.nospace() << "This is x: " <<info.x;
  8. return dbg.maybeSpace();
  9. }
  10.  
  11. private:
  12. int x;
  13. };
To copy to clipboard, switch view to plain text mode 

I have gotten this far by the good graces of Google. Any help would be greatly appreciated.