Results 1 to 3 of 3

Thread: Link error on Mac OS-X

  1. #1
    Join Date
    Jun 2013
    Location
    Northern Rivers, NSW Australia
    Posts
    14
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Link error on Mac OS-X

    Hi all,

    Long time since I posted last, also long time since I coded !

    Anyhow, I've moved on from Linux to OS X and am trying to re-compile my app to run under mac. Issue I'm having is getting a link error.
    Qt version:
    Qt Creator 3.3.0 (opensource)
    Based on Qt 5.4.0 (Clang 6.0 (Apple), 64 bit)

    Built on Dec 8 2014 at 15:34:58

    From revision d36c4d87db
    qmake output is:

    08:11:05: Starting: "/Users/vi/Qt/5.4/clang_64/bin/qmake" /Users/vi/Qt/BudgetTracker/BudgetTracker.pro -r -spec macx-g++ CONFIG+=debug CONFIG+=x86_64 QT+=widgets QT+=printsupport
    08:11:06: The process "/Users/vi/Qt/5.4/clang_64/bin/qmake" exited normally.
    When I try to build the project I get:

    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [BudgetTracker.app/Contents/MacOS/BudgetTracker] Error 1
    08:14:21: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project BudgetTracker (kit: Desktop)
    When executing step "Make"
    I should also mention it's failing when referencing a NCReport file (Ver 2.12.3)

    Qt Code:
    1. Undefined symbols for architecture x86_64:
    2. "NCReportPreviewWindow::setOutput(NCReportPreviewOutput*)", referenced from:
    3. MainWindow::printMenu() in mainwindow.o
    4. etc etc etc...
    To copy to clipboard, switch view to plain text mode 

    I think it may have something to do with selecting the right compiler or kit ?
    Last edited by Gretsch; 25th January 2015 at 21:30. Reason: spelling corrections

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Link error on Mac OS-X

    The linker can't resolve NCReportPreviewWindow. You need to add the the framework or directory using the LIBS qmake variable to instruct the linker where the library or framework lives as well as the library name to include, etc.

    I don't know where NCReport stuff may live on your system, but here's an example I used to include the Sparkle framework (from the .pro file):

    Qt Code:
    1. LIBS += -F$${PWD}/Sparkle/build/Release/
    2. LIBS += -framework Sparkle -framework AppKit
    To copy to clipboard, switch view to plain text mode 
    If NCReport is not a framework, then use -L to point to the library directory and -l to specify the library.

    Hope that helps.

  3. The following user says thank you to jefftee for this useful post:

    Gretsch (28th January 2015)

  4. #3
    Join Date
    Jun 2013
    Location
    Northern Rivers, NSW Australia
    Posts
    14
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Link error on Mac OS-X

    Thanks jthomps, moving the files into /user/lib did the job.

Similar Threads

  1. Replies: 3
    Last Post: 19th November 2014, 19:44
  2. Replies: 4
    Last Post: 29th April 2014, 16:20
  3. : error: [\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb\V ideo.exe] Error 1
    By ranjit.kadam in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 1st May 2011, 22:11
  4. Replies: 3
    Last Post: 23rd January 2011, 12:15
  5. fatal error C1001: An internal error has occurred in the compiler
    By noodles in forum Installation and Deployment
    Replies: 0
    Last Post: 12th August 2010, 11:24

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.