Results 1 to 7 of 7

Thread: connection database error: collect2: ld returned 1 exit status

  1. #1
    Join Date
    Mar 2014
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default connection database error: collect2: ld returned 1 exit status

    Hi All....
    Please Help Me....

    I was to traying connection MySQL database using Qt Creator 1.3.1, but i have the error message like this :
    error: collect2: ld returned 1 exit status

    I not understand for that message.
    login.cpp
    login.h
    login.ui
    main.cpp
    Sqlite_DB.pro

    Thanks

    Note : My OS is Ubuntu 10.04

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: connection database error: collect2: ld returned 1 exit status

    You'll need to post the full error message.

    The linker (ld) complained about something, usually a missing library.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2014
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: connection database error: collect2: ld returned 1 exit status

    Screenshot.jpg

    that is a screenshot of my program.

    I have installed
    - mysql-server-5
    - mysql-server-core-5
    - libqt4-sql-sqlite3
    - libqt4-sql
    - mysql-client-5
    - mysql-client-core-5
    - libqt4-sql-mysql
    - libmysqlclient-dev
    - g++
    o make
    o libglib2.0-dev
    o libSM-dev
    o libxrender-dev
    o libfontconfig1-dev
    o libxext-dev
    o libfreetype6-dev
    o libx11-dev
    o libxcursor-dev
    o libxfixes-dev
    o libxft-dev
    o libxi-dev
    o libxrandr-dev
    Last edited by edukasi; 1st April 2014 at 08:04.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: connection database error: collect2: ld returned 1 exit status

    Click on the "Compile Output" tab to get the full error message.

    Cheers,
    _

  5. #5
    Join Date
    Mar 2014
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: connection database error: collect2: ld returned 1 exit status

    When I open the "Compile output" tab, I have this messages

    make: Entering directory `/home/user/Documents/sqlite/Sqlite_DB'
    g++ -o Sqlite_DB main.o login.o moc_login.o -L/usr/lib -L/usr/X11R6/lib -lQtWebKit -lphonon -lQtMultimedia -lQtDBus -lQtTest -lQtScript -lQtScriptTools -lQtSvg -lQt3Support -lQtSql -lQtXmlPatterns -lQtXml -lQtOpenGL -lQtGui -lQtNetwork -lQtCore -lGLU -lGL -lpthread
    /usr/bin/ld: cannot find -lphonon
    collect2: ld returned 1 exit status
    make: *** [Sqlite_DB] Error 1
    make: Leaving directory `/home/sabix/Documents/sqlite/Sqlite_DB'
    Exited with code 2.
    Error while building project Sqlite_DB
    When executing build step 'Make'

    screenshot2.jpg

    And I open the Synaptic Package Manager for looking "phonon", I have this

    Synaptic Package Manager .jpg
    Thanks for All


    Added after 18 minutes:


    Thank You For All...

    I has connected to my database...

    connect.jpg
    Last edited by edukasi; 2nd April 2014 at 05:38.

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: connection database error: collect2: ld returned 1 exit status

    If your program does not require phonon then don't tell Qt to link it as your PRO file does now. Most of these:
    Qt Code:
    1. QT += network opengl sql script scripttools svg webkit xml xmlpatterns phonon multimedia qt3support testlib dbus
    To copy to clipboard, switch view to plain text mode 
    are not needed for your program, only:
    Qt Code:
    1. QT += sql
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Mar 2014
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: connection database error: collect2: ld returned 1 exit status

    Ok..
    I has deleted phonon.
    Now, My program can connect to database.

    Thank You All...

Similar Threads

  1. error: collect2: ld returned 1 exit status
    By Splatify in forum Newbie
    Replies: 2
    Last Post: 13th February 2011, 18:09
  2. Replies: 7
    Last Post: 10th February 2011, 23:35
  3. error: collect2: ld returned 1 exit status
    By srohit24 in forum Qt Programming
    Replies: 3
    Last Post: 1st December 2009, 06:32
  4. error: collect2: ld returned 1 exit status
    By nataly in forum Qt Programming
    Replies: 4
    Last Post: 13th October 2009, 13:39
  5. collect2: ld returned 1 exit status error
    By gmsk19 in forum Qt Tools
    Replies: 11
    Last Post: 25th July 2009, 02:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.