so i'm trying to implement some menus into my programs -- i have to be doing it the hard way. Here's my code in its entirety ... please, someone tell me there's an easier way!

Qt Code:
  1. #ifndef JAUS_H
  2. #define JAUS_H
  3.  
  4. #include <QMainWindow>
  5. #include <QVBoxLayout>
  6.  
  7. namespace Ui {
  8. class jaus;
  9. }
  10.  
  11. class jaus : public QMainWindow {
  12. Q_OBJECT
  13. public:
  14. jaus();
  15. ~jaus();
  16.  
  17. protected:
  18. void changeEvent(QEvent *e);
  19. void contextMenuEvent(QContextMenuEvent *event);
  20.  
  21. private:
  22. Ui::jaus *ui;
  23.  
  24. void createActions();
  25. void createMenus();
  26.  
  27. QMenu *fileMenu;
  28. QMenu *dataMenu;
  29. QMenu *helpMenu;
  30. QAction *exitAct;
  31. QAction *startLogAct;
  32. QAction *stopLogAct;
  33. QAction *debugAct;
  34. QAction *aboutAct;
  35.  
  36. private slots:
  37. void exit();
  38. void startLog();
  39. void stopLog();
  40. void debug();
  41. void about();
  42.  
  43. };
  44.  
  45. #endif // JAUS_H
  46.  
  47.  
  48.  
  49. #include "jaus.h"
  50. #include "ui_jaus.h"
  51.  
  52. jaus::jaus()
  53. {
  54. QWidget *widget = new QWidget;
  55. setCentralWidget(widget);
  56.  
  57. QWidget *topFiller = new QWidget;
  58. topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  59.  
  60. QWidget *bottomFiller = new QWidget;
  61. bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  62.  
  63. QVBoxLayout *layout = new QVBoxLayout;
  64. layout->setMargin(5);
  65. layout->addWidget(topFiller);
  66. layout->addWidget(bottomFiller);
  67. widget->setLayout(layout);
  68.  
  69. createActions();
  70. createMenus();
  71.  
  72. QString message = tr("JAUS Communicator - Version 0.1");
  73. statusBar()->showMessage(message);
  74. }
  75.  
  76.  
  77. jaus::~jaus()
  78. {
  79. delete ui;
  80. }
  81.  
  82. void jaus::changeEvent(QEvent *e)
  83. {
  84. QMainWindow::changeEvent(e);
  85. switch (e->type()) {
  86. case QEvent::LanguageChange:
  87. ui->retranslateUi(this);
  88. break;
  89. default:
  90. break;
  91. }
  92. }
  93.  
  94. void jaus::createActions()
  95. {
  96. exitAct = new QAction(tr("&Exit"), this);
  97. exitAct->setStatusTip(tr("Exit the application"));
  98. connect(exitAct, SIGNAL(triggered()), this, SLOT(exit()));
  99.  
  100. startLogAct = new QAction(tr("&Logging"), this);
  101. startLogAct->setStatusTip(tr("Enables Logging"));
  102. connect(startLogAct, SIGNAL(triggered()), this, SLOT(startLog()));
  103.  
  104. debugAct = new QAction(tr("&Debug"), this);
  105. debugAct->setStatusTip(tr("Turns Debugging On"));
  106. connect(debugAct, SIGNAL(triggered()), this, SLOT(debug()));
  107.  
  108. aboutAct = new QAction(tr("&About"), this);;
  109. connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
  110. }
  111.  
  112. void jaus::createMenus()
  113. {
  114. fileMenu = menuBar()->addMenu(tr("&File"));
  115. fileMenu->addAction(exitAct);
  116. fileMenu->addSeparator();
  117.  
  118. dataMenu = menuBar()->addMenu(tr("&Data"));
  119. dataMenu->addAction(startLogAct);
  120. dataMenu->addAction(debugAct);
  121. dataMenu->addSeparator();
  122.  
  123. helpMenu = menuBar()->addMenu(tr("&Help"));
  124. helpMenu->addAction(aboutAct);
  125. }
  126.  
  127. void jaus::about()
  128. {
  129.  
  130. }
  131.  
  132. void jaus::exit()
  133. {
  134.  
  135. }
  136.  
  137. void jaus::debug()
  138. {
  139.  
  140. }
  141.  
  142.  
  143. void jaus::startLog()
  144. {
  145.  
  146. }
  147.  
  148. void jaus::stopLog()
  149. {
  150.  
  151. }
  152.  
  153.  
  154.  
  155. #include <QtGui/QApplication>
  156. #include "jaus.h"
  157.  
  158. int main(int argc, char *argv[])
  159. {
  160. QApplication a(argc, argv);
  161. jaus w;
  162. w.show();
  163. return a.exec();
  164. }
To copy to clipboard, switch view to plain text mode 

When I compile this code I get the collect2: ld returned 1 exit status error message. I have no clue what this means, but hopefully I can find an easier way (maybe a drag/drop option??) to add menus to my programs. Thanks for any help!!