Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. :-1: error: symbol(s) not found for architecture x86_64
Forum Updated to NodeBB v4.3 + New Features

:-1: error: symbol(s) not found for architecture x86_64

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nicky j
    wrote on last edited by
    #1

    Hey n00b question.
    I know there have been several posts about this, but none of the suggestions I find help.

    Whenever I declare a slot in my .h file and define it in my .cpp file, it says that the 'symbols not found for x86_64'. However when I comment out the slot declaration and definition, my program compiles fine. I really want to have these slots, so how can I declare/define them and have them work?

    here is my code:
    browser_v1.pro:
    @QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += webkitwidgets

    TARGET = browser_v1
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS +=

    CONFIG += x86_64
    @

    mainwindow.h:
    @#ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>
    #include <QWebView>
    #include <QLineEdit>
    #include <QToolBar>
    #include <QGridLayout>

    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT

    public:
    MainWindow(const QUrl& url);
    void changeURLbarText();

    private slots:
    void changeURLbarText();
    void makeSearchURL();
    void makeSearch();

    private:
    Ui::MainWindow *ui;

    QWebView *webview;
    QLineEdit *URLbar;
    QLineEdit *SearchBar;
    QToolBar *NavBar;
    QGridLayout *mainLayout;
    

    };

    #endif // MAINWINDOW_H
    @

    mainwindow.cpp:
    @#include "mainwindow.h"

    MainWindow::MainWindow(const QUrl& Url)
    {

    webview = new QWebView(this);
    webview->load(Url);
    connect(webview, SIGNAL(loadFinished(bool)), SLOT(changeURLbarText()));
    
    URLbar = new QLineEdit(this);
    connect(URLbar, SIGNAL(returnPressed()), SLOT(makeSearchURL()));
    
    SearchBar = new QLineEdit(this);
    connect(SearchBar, SIGNAL(returnPressed()), SLOT(makeSearch()));
    
    QToolBar *NavBar = addToolBar(tr("Navigation"));
    NavBar->addAction(webview->pageAction(QWebPage::Back));
    NavBar->addAction(webview->pageAction(QWebPage::Forward));
    NavBar->addAction(webview->pageAction(QWebPage::Reload));
    NavBar->addAction(webview->pageAction(QWebPage::Stop));
    NavBar->addWidget(URLbar);
    NavBar->addWidget(SearchBar);
    
    
    setCentralWidget(webview);
    setUnifiedTitleAndToolBarOnMac(true);
    

    }

    void MainWindow::changeURLbarText()
    {
    URLbar->setText(webview->Url().toString());
    }

    @

    main.cpp:
    @#include "mainwindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QUrl Url;
    Url = QUrl("http://www.google.com/ncr");
    //MainWindow w;
    //w.show();
    MainWindow *browser = new MainWindow(Url);
    browser->show();

    return a.exec&#40;&#41;;
    

    }
    @

    if it matters, I am using a Macbook Pro OS X 10.9 (64 bit), Qt 5.2

    thanks in advanced for your help!

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nicky j
      wrote on last edited by
      #2

      Ok so I can barely develop now because the program crashes before it can launch. I have tried making another program and I am having the same results. I am running using debug instead of release. There is nothing that I can find wrong with my code.

      Is this a problem with running Qt on OS X? Or a problem with Qt 5.2. My Linux computer has never had this problem before.

      Please help!

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved