Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Compile Qt-5.1 project for OSX 10.9 on OSX 10.8 machine
I have a project that compiles fine with Qt 5.1. on OSX 10.8. Now I need to compile the same project for OSX 10.9, but still from my OSX 10.8 machine. I've been told that I need Qt 5.2 to do so. I installed Qt 5.2 and opened my project in Qt Creator 3.0.1 but it won't compile. The build folder is being created but it's empty except for a Makefile.
What would be the best way to compile a 5.1 project for OSX 10.9 on a 10.8 machine? Is that even possible?
If you have Xcode 5.1 installed you should be fine.
(The differences between 10.8 and 10.9 aren't that great, it should be possible to compile on 10.8 and deploy on 10.9.)
EDIT: you might also check you're updated your Mountain Lion to 10.8.5.
I opened my 5.1 project with Qt Creator 3.0.1 and built it. I get this message:
@08:08:44: Configuration unchanged, skipping qmake step.
08:08:44: Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
08:08:44: The process "/usr/bin/make" exited normally.
08:08:44: Elapsed time: 00:01.@
and on the build directory there's a lonely Makefile and nothing else. I tried editing the code a bit, but still get nothing.
I checked and I've got both Xcode 5.1 and OSX 10.8.5
Hmmm, can you post your .pro file?
I just realized I had specified different DESTDIRs... dumb me. Sorry about that. Anyway still can't make it work on 10.9 even though I added @QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9@
to my project Buil Steps.
Ok, when you copy your app to 10.9, what kind of error do you get?
The app crashes before starting
Reading the crash details helped. The 10.9 machine does not find the qt libraries. Do I have to install Qt to run it?
I tried with an fresh new empty project, but I get the same result.
Here's the log after crashing:
@Process: Teatrillu-GUI 
Code Type: X86-64 (Native)
Parent Process: launchd 
Responsible: Teatrillu-GUI 
User ID: 501
Date/Time: 2014-03-14 08:46:21.486 +0100
OS Version: Mac OS X 10.9 (13A603)
Report Version: 11
Anonymous UUID: 39103189-3D57-5708-51F2-827D0F2597D8
Crashed Thread: 0
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: /Applications/Qt5.2.1/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
Referenced from: /Users/USER/Downloads/*/Teatrillu-GUI.app/Contents/MacOS/Teatrillu-GUI
Reason: image not found
0x7fff65b1b000 - 0x7fff65b4e817 dyld (239.3) <D1DFCF3F-0B0C-332A-BCC0-87A851B570FF> /usr/lib/dyld
Model: MacBookPro9,2, BootROM MBP91.00D3.B09, 2 processors, Intel Core i5, 2.5 GHz, 16 GB, SMC 2.2f44
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In, 1024 MB
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x0000, 0x4B4554454348FFFFFFFFFFFFFFFFFFFFFFFF
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x0000, 0x4B4554454348FFFFFFFFFFFFFFFFFFFFFFFF
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xF5), Broadcom BCM43xx 1.0 (22.214.171.124.22)
Bluetooth: Version 4.2.0f6 12982, 3 services, 23 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: APPLE HDD HTS545050A7E362, 500,11 GB
Serial ATA Device: HL-DT-ST DVDRW GS41N
USB Device: Hub
USB Device: Flash Disk
USB Device: FaceTime HD Camera (Built-in)
USB Device: Hub
USB Device: Hub
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
USB Device: IR Receiver
Thunderbolt Bus: MacBook Pro, Apple Inc., 25.1
Yes, if you install Qt on the 10.9 computer that will help. You have to install in the exact same path as on your 10.8 computer though.
A better way is, before you copy your app to the 10.9 computer, you run a utility app in Qt called macdeployqt you can read about how you do that in "my blog post":http://www.tripleboot.org/?p=138 (scroll down and look for "Mac clang compiler")
Ah, right, I forgot about macdeployqt... sorry about that. Thanks!