You are currently viewing the BOOK: Beginning Mac OS X Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I'm on Chapter 3 of the book, and can't seem to get the default "Hello" project compiled. I select my Documents directory, hit "Build and Go" and just get the following error:
No launchable executable present at path.
/Users/Ari/Documents/Hello/build/Debug/Hello
I have no idea why the path is wrong. I don't do anything other than create a project with Xcode and attempt to compile. Any help would be much obliged.
Never mind. I seem to have solved that problem, but I'm stuck with another one; I can built my project in Debug mode fine, but when I try to build it in Release mode, Xcode complains that there are "Undefined symbols" and goes on to list functions like printf() and scanf(), as well as some other kernel stuff. I don't know what libraries the linker can't find. Can anyone help me with this?
Oh I see. Xcode 2.2 (which I assume you are using) adds a "SDK Path" to all its new projects. This path must point to a collection of libraries and header files in the /Developer/SDKs/ directory. It may be your installation of Xcode does not include the default SDK for some reason (on my system, it's /Developer/SDKs/MacOSX10.4u.sdk ) and as a result Xcode doesn't link properly.
This is a problem because Xcode 2.2 is trying to build a Universal Binary containing both ppc and intel segments. It looks like the default 2.2 standard tool project will try to build for both architectures. This requires the MacOSX10.4u.sdk to work, since only ppc symbols are installed by the operating system.
So, one solution is to re-run your Xcode installer and make sure all the SDKs and compatibility libraries are installed. Then Xcode will link your program against the proper files.
Another solution is to change your target to build only for PowerPC.
1) Double-click your Hello Target in the Groups & Files list
2) Select the Build tab and make sure "All Configurations" and "All Settings" are visible
3) Doubleclick the word Architectures in the build settings table. A sheet will appear with two checkboxes: ppc and intel. Both checkboxes will be unchecked.
4) Check ppc and click OK
Your project should now just build a simple PowerPC binary, link against the standard system files, and work properly.
The message "No launchable executable present at path" appears to be the result of bug in Apple's Xcode. By default, the Apple's compleementary SDK (Software Development Kit) is installed on the first level of the hard drive directory (right near the "Applications", "Library", "System" and "Users" folders).
It seems that if the SDK ("Developer" folder) is removed from the default location it is installed at and placed elsewhere, Xcode's "Build" will not work normally. That is, when attempting to "Build" a C++ file, the message, "No launchable executable present at path", may appear. If this message appears, "Build" will likely not perform its usual functions (compile, link etc.).
The problem appears to stem from a pre-assigned path in Xcode for "MacOSX10.4u.sdk" or "MacOSX10.3.9.sdk" being inconsistent with the actual path of these folders.
There have been reports on other online forums of individuals being able to circumvent the problem, but not effectively solve the problem--modify the path of "MacOSX10.4u.sdk"
I am presently unsure as to whether or not the pre-assigned path (for the folders in the preceding paragraph) can be modified. Preferably, I would like to keep Apple's SDK in my "Applications" folder without compensating for the hassle of having to deal with the above problem.
If someone does know how to alter the pre-assigned path "MacOSX10.4u.sdk" in Xcode, I would be delighted to know.