Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mac > BOOK: Beginning Mac OS X Programming
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 7th, 2005, 05:03 PM
Registered User
Join Date: Aug 2005
Location: Painesville, Ohio, USA.
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).



  #2 (permalink)  
Old August 23rd, 2005, 07:27 PM
Registered User
Join Date: Aug 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

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.
  #3 (permalink)  
Old August 28th, 2005, 04:29 AM
Registered User
Join Date: Aug 2005
Location: San Francisco, California, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

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: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: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?
  #4 (permalink)  
Old August 29th, 2005, 02:36 PM
Registered User
Join Date: Aug 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

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.

  #5 (permalink)  
Old March 22nd, 2006, 03:18 AM
Registered User
Join Date: Mar 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

zero-link is on by default in new xcode projects, this link tells you how to turn it off by default:
  #6 (permalink)  
Old August 17th, 2006, 02:04 PM
Registered User
Join Date: Aug 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 06:19 AM.

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