Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Mac > BOOK: Beginning Mac OS X Programming
|
BOOK: Beginning Mac OS X Programming
This is the forum to discuss the Wrox book Beginning Mac OS X Programming by Michael Trent, Drew McCormack; ISBN: 9780764573996
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Mac OS X Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2005, 05:03 PM
Registered User
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kowalke
Default Debug example seemingly not quite right on page 78

I've gone through the xcode debugging example on page 78 4-5 times now, yet I'm still not getting taken to the screen with example 3-22. My program is the same, it runs fine, but I'm not getting screen 3-22. Instead, when I step into as the book says in step 20, I'm taken to line 25:

    printf("%d %c %d = %d\n", a, op, b, answer);

So, what am I doing wrong? All I can think is that it has something to do with using Xcode 2.1, or that my Active Build Configuration doesn't seem to have "development" (just "debug," "release," and "default"--I have it set to debug).

Thanks.

-Peter

http://www.grownwithoutschooling.com
 
Old August 23rd, 2005, 07:27 PM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm experiencing the same problem with xcode 2.1. I can get the debugger to step into the calculate function if I set a break point somewhere in calculate.c otherwise it won't step in regardless of what I do. I don't think it should work this way. I dabbled with gdb and was able to step into calculate regardless of the break point setting in calculate.c.

I don't know what the problem is and some fairly extensive web searching has not come up with anything clear.
 
Old August 28th, 2005, 04:29 AM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I too had this problem, but I just figured out how to resolve it.

1. In the project window, expand the disclosure triangle next to Targets.
2. Under Targets, select Calculator.
3. On the toolbar, click on the Info button. A window titled "Target 'Calculator' Info" will appear.
4. In that window, select the Build tab.
5. In the combo box next to "Configuration," select "Active Configuration (Debug)."
6. In the combo box next to "Collection," select "Linking."
7. Uncheck the box next to ZeroLink.

Now the "Step Into" example should work.

Here's what the Xcode User Guide says about Zerolink:

Quote:
quote:ZeroLink speeds application development time by eliminating the link process from development builds. Instead, Xcode generates an application stub that contains the full paths to the object files that make up the application. At runtime, each object (.o) file is linked as it’s needed. This works only when running your application within Xcode. You cannot deploy applications using ZeroLink.

To turn ZeroLink on or off, use the ZeroLink (ZERO_LINK) build setting. ZeroLink is enabled by default in the Debug build configuration. If you build with this build configuration, you automatically get ZeroLink functionality. See “Build Configurations” for more information on using build configurations. ZeroLink works only for native targets.
I gather the debugger finds this last-minute linking to be confusing. Another thing I noticed about Zerolink: originally I mistyped the name of the calculate function when I called it, and the error wasn't caught until runtime. This seems like a "feature" I can live without.

One thing confuses me. According to the release notes:

Quote:
quote:The project’s build settings exist “below” the target’s build settings, so every target in a project will be based on the project’s build settings.

For example, if you set “Zero Link” to YES in the “Debug” configuration for the project, it is used by default in the “Debug” configuration on all targets in the project. Setting “Zero Link” on the “Debug” configuration of a target will override the setting inherited from the project.
Yet if you check the project build settings (select Project->Project Settings), Zerolink is unchecked. So the target's Zerolink setting isn't being inherited from the project. But then, where is it coming from?
 
Old August 29th, 2005, 02:36 PM
Registered User
 
Join Date: Aug 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you, this helps quite a bit, and I ended up reading about zerolink. I'll leave it off for now. As for the discrepancy on Project settings vs Target settings I notice that if I create a new target it will immediately inherit any changes to the Project settings while the original target does not. Bug? I don't know enough to even guess.

 
Old March 22nd, 2006, 03:18 AM
Registered User
 
Join Date: Mar 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

zero-link is on by default in new xcode projects, this link tells you how to turn it off by default:
http://www.borkware.com/miniblog/one...try%5fid=45678
 
Old August 17th, 2006, 02:04 PM
Registered User
 
Join Date: Aug 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks rhanneken,

I was having the exact same problem. I figured it would have been an XCode bug but didn't even have the slightest clue on how to fix it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Debug arholly Access VBA 19 December 18th, 2006 01:52 PM
Seemingly Complicated Query help needed krashed SQL Language 5 March 31st, 2006 01:02 AM
Please Help. mr_newreq.jsp:78: jsp:useBean can't f batken JSP Basics 0 February 22nd, 2006 09:56 PM
aspx elements seemingly appearing out of nowhere. Grumpy ASP.NET 1.0 and 1.1 Basics 3 December 15th, 2005 11:45 AM
downloads for VB Oracle 8 1-861001-78-9 johnfreed0 All Other Wrox Books 6 September 23rd, 2004 07:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.