Qt without Xcode - macos

Is it possible to use Qt and Qt Creator on MacOS with Command Line Tools only, i.e. without installing the whole Xcode?
I'm asking because I'm getting "Project ERROR: Could not resolve SDK Path for 'macosx'" and all the solutions I read ask for full Xcode.

I had the same question when I wanted to install Qt on an old MacBook Air that can't run the version of macOS that XCode now requires.
I found this document detailing how to install Qt without XCode.
It does complain about XCode not being present, but as the document notes you can ignore that and proceed anyway.
(Note: solution didn't solve my problem for a couple obscure reasons, but I'm leaving the answer because it is an additional option not yet mentioned.)

Related

XCode on Apple M1 shows "linking in object file built for iOS" or "ld: warning: directory not found for option" or "'Framework not found"

I am trying to compile a "WebViewGold" ios app on an M1 processor MacBook Pro, using XCode latest (13.4.1) version.
I have greatly struggled to find a solution to those XCode error codes.
I have browsed related answers in threads like: building for iOS Simulator, but linking in object file built for iOS, https://stackoverflow.com/questions/32687105/framework-not-found-in-xcode,https://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option.
Nothing mentioned in the above answers worked!
Any idea about what I should do?
There is a possible, very simple solution provided by this answer.
Basically, freshly upgraded versions of XCode (for example, 13.4.1) running on Apple Silicon-powered Macs (like my M1 MacBook Pro), have components that cannot properly use/output the appropriate object files in all the output platform combinations you need.
This leads to some "interesting" issues and error message cross-overs that find "almost correct" answers on StackOverflow. Hence the many suggestions to exclude "arm64" platform and similar from the build options.
The simple answer to all of that is... to just run XCode with Rosetta enabled. Rosetta will engage with the components that miss the needed cross-platform capabilities.
Here is an example of how to enable an application to use Rosetta.
You select the app icon, then go to the File menu and select "Get Info".
Then click the "Open using Rosetta" checkbox.
It does seem that Build Active Architectures Only = NO is the issue, at least in Debug mode. I can successfully produce a Release archive, so I'd suggest just leaving it alone unless you're trying to debug the Intel version. Try a library, as you can ship the binary that way.

How to Build an Application compatible with older MacOS with Xcode?

I just installed the latest version of Xcode (10.1) on MacOS 10.14 (Mojave).
I can build my application and it runs fine on my Mac or similar system.
However, I want to share this application with someone using MacOS 10.11 (El Capitan) and it fails to launch, asking for a minimum requirement of MacOS 10.13 (High Sierra).
My application is only very simple, can't I compile it to be compatible with older MacOS ?
After some research, I did download MacOSX10.11.sdk
(from https://github.com/phracker/MacOSX-SDKs/releases/).
I did decompress it, and drag it into:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
(This folder originally contains only "MacOSX.sdk" and a link pointing to it, named "MacOSX10.14.sdk")
I also noticed the value of the string "MinimumSDKVersion" from the file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist is equal to "10.11", which sounds good in my case.
I read on some forums adding additional SDK versions into Xcode is not supported. And by the way, I cannot see any menu from Xcode to specify my target build (neither in Xcode Preferences, nor in the project settings (see picture below).
Where can I tell Xcode to use, let's say "MacOSX10.11.sdk" over "MacOSX10.14.sdk"?
And, is there a better way?
Or, do I have to install an old version of MacOS on a different partition, with an old version of Xcode (which would be a pain)?
I am not sure if this still works on Mojave, but there is a project called XcodeLegacy which is created specifically with this intention in mind:
https://github.com/devernay/xcodelegacy
Regarding the menu, you can find it at: Xcode -> Select File -> Project/Workspace Setting
Open Workspace Settings
Works on Xcode 13, I'm a bit late to the party but just had the very same question.

Apple Command Line Tools AND XCode For Open Source Compile/Build?

I don't use XCode but have it "left over" from when it was the path to installing the Apple Command Line Tools - which I do use for compiling/building other software. I now seem to have both XCode and Apple Command Line Tools and don't really care to continue updating XCode every few months (huge download).
My 2 questions before deleting XCode:
Will Apple Command Line Tools remain on my machine and usable for open source build/compile if I trash XCode?
Will I lose some useful functionality I don't know about elsewhere (if I really never do use XCode)?
Question 2.5: Is this a safe delete?
This post was similar but unanswered.
Thanks!
Xcode is required when building MacVim from Homebrew. The Command Line Tools alone are insufficient. I reinstalled Xcode...

../include/wx/mac/carbon/private.h:1459: error: ‘Cursor’ does not name a type

I have been using RapidSVN on a Linux machine for the past few years - it has become an excellent tool for managing my source.
Yesterday my trusty Linux laptop had a couple of strokes so I decided it was time to replace it. Today I went out and purchased a new Mac Book Pro with the flashy display and solid state drives.
Then I went hunting for an SVN tool to run on Mac. I found that RapidSVN will run on a Mac as it was developed using wxWidgets (cross platform windowing).
So, I needed to install wxWidgets, however this doesn't come as an executable so I had to download the tar ball. To compile I realised I don't have a compiler installed yet... so, install Xcode 4.4, then learn that doesn't install a compiler either... find the Xcode preference to install the command line tools (compiler).
So, now I have Xcode installed, a gcc compiler, and tracking back up it comes to wxWidgets. It takes a little working out but I manage to extract the files into a directory in my home folder, (following instructions of course), and from the 'build' folder I run the ../configure command (which seems to work) and then the 'make' command which fails:
In file included from ../include/wx/mac/private.h:4,
from ../src/common/dynlib.cpp:48:
../include/wx/mac/carbon/private.h:1459: error: ‘Cursor’ does not name a type
../include/wx/mac/carbon/private.h:1488: error: ‘ClassicCursor’ does not name a type
make: *** [baselib_dynlib.o] Error 1
So I go hunting for a solution only to find this bug: http://trac.wxwidgets.org/ticket/14536 which unfortunately indicates this is not going to be fixed.
Changed 10 months ago by csomor
* status changed from new to closed
* resolution set to wontfix
A dismal day in the land of computers. I am now stuck for the next 5-6 years on a computer that will never be able to compile anything using wxWidgets - I rather feel like taking it back to Apple and getting my money back.
So where to from here? Is there a binary version of wxWidgets available? Is there a binary version of RapidSVN available? Should I downgrade to OSX 10.x something less than I am currently on? Should I upgrade to unstable wxWidgets?
This is an interesting but not very understandable read. What exactly are you trying to achieve? If you're looking to use the best available version of wxWidgets under OS X, get 2.9.4 or the current svn version and build it using the Xcode version you have already with Cocoa support. If you absolutely need to continue to use Carbon (why?), either install Xcode 3, available from Apple, or get 10.6 (or 10.5) SDK in some other way and pass it as the SDK to use to configure using --with-macosx-sdk option as explained in the documentation.
VZ is right. If you need to use wxWidgets 2.8 on OS X (and there are legitimate reasons for needing to do so), get the 10.6 SDK. Copy it alongside the already installed 10.7 and/or 10.8 , and select it in the project/target's build settings.
From here I have given up trying to compile anything on my current OSX. I am not going to downgrade or install multiple versions of different libraries in order to satisfy the lack of support for the latest current stable versions.
From here I will download and install binaries only.
I have Mac OSX Lion and just did this:
brew install wxmac
and was able to get through the install with no issues.

GCC without Xcode on OS X

I've just unwrapped my new MacBook Pro (yay!) and am now setting it up properly for development. Since I want to avoid clutter, I'm wondering if I really need to install the Xcode tools at all (I never use the IDE or Mac specific tools), since I'll install a newer version of GCC anyway, using MacPorts.
So, is there any benefit in installing Xcode? Is it necessary? What kind of set-up does it do behind the scenes? Basically: can I skip this or will it come back to haunt me because some Unix development tools just assume that OS X is always set up in this way?
In order to perform an easy and successful install of MacPorts, already having tools from the xCode installer is necessary. You only need the install option that places a copy of the unix/header files outside of xcode; everything else can remain uninstalled.
A friend of mine recently released this:
https://github.com/kennethreitz/osx-gcc-installer
Have fun :)
I tried this trick and I was constantly chasing missing header files and such. Just install XCode.
We primarily use the Xcode IDE for building Cocoa/Carbon applications. Xcode typically has different project templates (and project settings fixed accordingly). As long as you are not going to generate a Universal Binary or a framework I think you should be ok. As far as I am concerned, when I am too pissed with Xcode, I go back to the command line, set up the paths myself and start using GDB.
First of all, congratulations on the new MBP. I recently bought a 15" unibody myself. =)
You can safely skip Xcode installation, and you can install almost everything Xcode installs through MacPorts, except Xcode itself, of course.
However, I believe you'll find yourself installing Xcode one day anyway, and installing Xcode is much easier than installing all the tools (especially GCC) through MacPorts.
You can strip down the Xcode install quite a lot - when you install Xcode there is a "Customise" button where you can remove a lot of stuff (gigabytes worth).
You can also go in and delete stuff from /Developer/, for example the 10.3 SDK is about 150MB (I think), and if you're not writing software for that it's quite safe to delete. Obviously be careful when deleting, but if you break things, you can always reinstall the Developer Tools!
Apple now provides the command line tools as a separate download from Xcode. They work with Lion and Mountain Lion. You can download them from the Apple Developer Center.
(This is noted on the osx-gcc-installer GitHub page.)

Resources