PDA

View Full Version : Link error on Mac OS-X



Gretsch
25th January 2015, 21:18
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)


Undefined symbols for architecture x86_64:
"NCReportPreviewWindow::setOutput(NCReportPreviewOu tput*)", referenced from:
MainWindow::printMenu() in mainwindow.o
etc etc etc...

I think it may have something to do with selecting the right compiler or kit ?

jefftee
26th January 2015, 17:27
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):



LIBS += -F$${PWD}/Sparkle/build/Release/
LIBS += -framework Sparkle -framework AppKit
If NCReport is not a framework, then use -L to point to the library directory and -l to specify the library.

Hope that helps.

Gretsch
27th January 2015, 11:47
Thanks jthomps, moving the files into /user/lib did the job.