Qt Development on OS X Mountain Lion

1. October 2012 21:18 by Cameron in C++, Mac, Mac OS X, Qt  //  Tags: , , , , , ,   //   Comments

OS X Mountain Lion changes a few things on how XCode is installed. Xcode is now contained in an app bundle and the SDKs directory is part of the bundle contents, thus you will need to update your SDK paths in your project file like so:

MAC_SDK  = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
    if( !exists( $$MAC_SDK) ) {
        error("The selected Mac OSX SDK does not exist at $$MAC_SDK!")
    }
    QMAKE_MAC_SDK = $$MAC_SDK

If you want to support Snow Leopard as a target platform with your Qt applications, be sure to use the 10.7 SDK and not the default 10.8 SDK. Your app should work just fine in Snow Leopard provided that you don't make any calls to Lion specific features while using the 10.7 SDK.

Another important thing is to install the command line tools for GCC so that Qt can find the compiler during installation and successfully compile C/C++ applications from Qt Creator. If you do use the 10.8 SDK with any Qt version less than Qt 5.0, it will give warnings that OS X 10.8 is unsupported during compilation. These warnings can be safely ignored. Aside from that, everything else should be the same as before. Happy coding!

MSI GT70 0ND-202US Gaming Laptop/Hackbook

28. August 2012 00:51 by Cameron in   //  Tags: , , , , , , , , ,   //   Comments

I recently bought a gaming laptop from MSI on Newegg with some pretty excellent specifications:

http://www.newegg.com/Product/Product.aspx?Item=N82E16834152347

Laptop: MSI GT70 0ND-202US Z77M, Intel Core i7-3610QM 2.3GHz, 12GB DDR3 RAM, 750GB Hitachi, 250GB WD, NVIDIA GTX 675M / Intel HD 4000 (Optimus), Realtek HD Audio (voodoohda), Wireless-N Atheros 9285 Half mini PCI  Express Card - Windows 8 Professional x64 RTM, OS X Mountain Lion 10.8.2 Retail

Preinstall

To install OS X Mountain Lion, download the Mountain Lion installer from the App Store (MacOS X 10.6.8 or higher) and use Unibeast to create a USB installation disk. Once the disk is created, you can then boot from the flash drive to install Mountain Lion! At the boot prompt, be sure to boot verbose using the '-v' option and also set 'GraphicsEnabler=No' as at the time of writing this guide, the NVIDIA GTX 675M cannot be used as the primary GPU and the Intel HD 4000 will need some tweaks later to get QE/CI. Once in the installer, you will need to choose where to install OS X Mountain Lion. You can install to your existing disk on a separate partition or install to a secondary disk (recommended). You will need to make sure that the hard drive you are installing ML to is using the GUID partitioning map and not MBR. If you need MBR, you'll need to patch the installer.

Postinstall

Multibeast

Wifi

The MSI GT70 0ND-202US comes stock with an Intel Centrino Wireless-N 2330 mini PCI Express card which will need to be subbed out with another compatible card. Swapping cards is fairly simple. All you need to do is pop up the speaker panel and disconnect the existing card and replace with the new one. One thing that you must do is make sure the Wifi LED is lit, otherwise, you won't be able to use the card. Here's a complete guide on how to choose an appropriate replacement card and how to get it working: http://www.tonymacx86.com/network/58146-guide-airport-half-mini-pcie.html

Intel HD 4000 QE/CI

Using the MacBook Pro 9,1 SMBIOS, LegacyAGPM.kext, 1920x1080x32, and DSDT injection for 01660004 you can achieve QE/CI. It should also be noted that I have removed AppleIntelSNBFramebuffer.kext as it is not needed with the Intel HD 4000 (probably could stop the kext from loading with DSDT later). Here's the DSDT patch for injecting the ig-platform-id:

into method label _DSM parent_adr 0x00020000 remove_entry;
into device name_adr 0x00020000 insert
begin
        Method(_DSM,4,NotSerialized)\n
        {\n
                Store(Package(0x02)\n
                 {\n
                                "AAPL,ig-platform-id",\n
                                Buffer(0x04)\n
                                {\n
                                   0x04,0x00,0x66,0x01\n
                                },\n
                        },Local0)\n
                DTGP (Arg0,Arg1,Arg2,Arg3,RefOf(Local0))\n
                Return(Local0)\n
        }\n
end


Using DSDT Editor, you'll have to apply the above patch as well as the DTGP patch from the patches directory.

Sound

VoodooHDA 2.7.2 - note, you'll have to edit the Info.plist in VoodooHDA.kext so that there isn't a hissing sound coming from the VoodooHDA prefpane. 

USB 3.0 fix (temporary)

One thing that I have found is that if you remove AppleUSBXHCI.kext from the plugins in IOUSBFamily.kext, it will treat USB 3.0 ports as just USB 2.0 ports and crashing no longer happens. This is a temporary fix until full USB 3.0 support exists (possibly in a later update). Make a backup of your existing IOUSBFamily.kext and then do the edits and re-install using Kextbeast.

Kexts

 Here's the voodoo kexts that I use for my laptop. Included is a kext for the battery, audio, and trackpad (multitouch).

voodoo_kexts.zip (212.01 kb)

 Here's my patched DSDT. As I make edits to my DSDT, I'll upload this attachment. I hope this helps for anyone with my laptop or similar.

dsdt.aml (47.02 kb)

 

 

Qt Application Development in Mac OS X Lion

1. February 2012 01:52 by Cameron in Qt, Mac OS X, C++  //  Tags: , , , , ,   //   Comments

I've been working on some code using the QtSDK lately and I've been researching how to deploy applications for Mac OS X 10.6 and above. Luckily, it's pretty simple to deploy applications as the QtSDK includes a tool called macdeployqt. The tool copies all required Qt frameworks to the app bundle and re-assigns the library reference paths for the app to use the libraries within the app bundle and not the user's system directory (/usr/lib). It doesn't copy 3rd party libraries that aren't in the /usr/lib directory so you will have to manually add those.

Please note that macdeployqt on Qt 4.7.x doesn't seem to assign the correct library paths when linking against QtWebKit. This is a known bug that was fixed in Qt 4.8.0.

Also, if you want to insure that your app will not have problems on Snow Leopard, be sure to add this to your .pro file: 

macx:QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.6.sdk

This tells Qt to use the Snow Leopard SDK instead of the Lion SDK. If you build your application with the 10.6 SDK, it will work with Mac OS X 10.6 or higher.

One last thing is that there seems to be a problem with Xcode 4 and Qt Creator not being able to find g++-4.2 which is installed with older versions of Xcode. A work around for this until a new version of Qt Creator:

sudo ln -s /usr/bin/g++ /usr/bin/g++-4.2

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

I hope this helps anyone experiencing the same issues.

 

EDIT:
As of the February 1, 2012 QtSDK update, it appears as though the problems with g++ and using macdeployqt have been fixed. Please be sure to update to the latest SDK release. 

Month List

Tag cloud