Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

Archive for March, 2013

How to link .o file build by "as" in xcode (with C file) ?

The "as" assembler was called in Terminal by

   as -L -n -static -o q_asm.o q_asm.s

and global declacred by

   .globl _func

q_asm.o is added to the project and func is declared in header by

   extern int func(int);

The linker complaint

   ld: warning prebinding disabled because of undefined symbols
   ld: Undefined symbols:  _func

I also try (from Terminal)

   ld -r -static -o q_asm.out q_asm.o

and I replace q_asm.o by q_asm.out but I got the same error message.

Next I try  (from Terminal)

   gcc-3.3 -x assembler -arch ppc -o q_asm.o q_asm.s

but I got thousand of syntax error (q_asm.s is a very large file).

I also try to install "Xcode Tools 1.1 Assembly Rule plug-in for Xcode 1.1"
I was able to link a small assemler file, but for q_asm.s I got the
same thousand of syntax error.

How to link .o file build by "as" in xcode (with C file) ?

.
posted by admin in Uncategorized and have Comment (1)

programming midi/quicktime on mac os 9 (actually 9.1)

Hi,

I would like to be able to access the musical instruments that are
part of Quicktime for mac os 9.1 (can’t remember which release of Quicktime –
I think 5 or 6). That is, I would like to execute procedures that play
various notes on various instruments. Imagine I’m about to try my luck at
music notation software for the mac (os 9.1). Does anybody out there know
where I could find documentation for this?

Another question (sorry for cheating) is, is there some documentation somewhere
about how to access/play the instruments/notes of some of the fancier
software synthesizers out there.

Thanks for ANY help.

Ken Quirici

posted by admin in Uncategorized and have Comments (2)

FSFindFolder Question

I am using FSFindFolder() call to find my framework.  My framework is
in /Library/Frameworks folder (As per Apple) – Unfortunately the call
to FSFindFolder does not seem to have an OSFileType definition to be
able to find the framework in the /Library/Frameworks folder.  The
only definition is kFrameworksFolderType which will point you to the
/System/Library/Frameworks folder.

My question is this – Is there an OSFileType definition that will
point me to the /Library/Frameworks folder so I do not have to put our
framework in /System/Library/Frameworks folder?

Thanks in advance!

JB
John Bahun
Roper Scientific / Photometrics Inc.

posted by admin in Uncategorized and have Comments (2)

MVC question

My model knows nothing about either the view or the controller. I believe
that this is a must.

The controller knows about the model and view, which also makes sense.

When something changes in the model, a NSNotification message is sent to a
defaultCenter queue.  Now, I have the view listening for the notification.  
The view calls some methods in the model.

So the question is that should the view know about the model? Or should only
the controller know about the model.  It just seems a little waste to have
the controller listen for the notification and then just call a method in the
view.

Thanks in advance.

J

posted by admin in Uncategorized and have Comments (2)

WTB: Leaning Codewarrior package

I live in New Zealand (postcode 3002) and will entertain any reasonable
offers and pay any reasonable shipping. I prefer to pay via Paypal, but
can also use Bank Drafts, cash through the mail (small amounts only, and
I reserve the right to decline this form of payment) or if you live in
New Zealand as well, a direct payment to your bank account or personal
check.

If you’ve any other Mac, Nintendo GB, GBC, GBA games or serious Mac
software you’d like to part with, let me know. I’ve also a few games I’m
wanting to sell, so mabe a trade could be worked out. Just ask for a
list.

Regards,
 Jamie Kahn Genet

"The surest sign that intelligent life exists elsewhere in the universe
is that it has never tried to contact us." – Calvin and Hobbes (Bill
Watterson)

posted by admin in Uncategorized and have Comment (1)

Stack and "as" assembler in Xcode

This is code assembled by "as" and disassembled by Xcode

   0x0001b618  <+0000>  mflr  r0
   0x0001b61c  <+0004>  stwu  r0,-4(r1)
   0x0001b620  <+0008>  lwz   r0,0(r1)
   0x0001b624  <+0012>  addi  r1,r1,4
   0x0001b628  <+0016>  mtlr  r0

The register just after mflr:

   r0 and lr are 0xb000
   r1 is 0xf005fce0

At the stwu instruction gdb report

   Current language:  auto; currently c
   warning: ppc_frame_chain_valid: stack pointer from 0xf005fcdc to 0xb000
grows upward; assuming invalid

   mi_cmd_stack_list_frames: Not enough frames in stack.
   mi_cmd_stack_list_frames: Not enough frames in stack.

If the line

    stwu r0,-4(r1)

is replaced by

   addi  r1,r1,-4
   stw      r0,0(r1)

the execution fail at the addi instruction and gdb report the same message.

Why lowered the stack pointer by only 4 bytes is wrong ?
Is there anything I miss about calling assembler function from C.
Do I need create my own stack space ?

posted by admin in Uncategorized and have Comments (3)

java "package" statement with XCode

I have a small project from NetBeans that I would like to "import"
into XCode.
It is a Swing app.
I do "New Project" for a Swing Application. I can’t get my directory
structure/package structure into the project. I add the files but I
get class not found exceptions.

I then tried to make a simple Java Tool with a 3 level deep package
structure.
The tool generated a class with a Main. It did not ask any info for
creating a package or anything.

I just don’t understand XCode.
Does it only work with the default package?
How do I set up a simple example for a java tool?
I would like something like:

package org.mystuff.teststuff;
import …
public class TheClass {
   public void Main…

Thanks!

posted by admin in Uncategorized and have Comments (6)

WTB: CodeWarrior Discover Programming

Excuse my earlier post. I meant I wanted to buy the CodeWarrior Discover
Programming package.

I live in New Zealand (postcode 3002) and will entertain any reasonable
offers and pay any reasonable shipping. I prefer to pay via Paypal, but
can also use Bank Drafts, cash through the mail (small amounts only, and
I reserve the right to decline this form of payment) or if you live in
New Zealand as well, a direct payment to your bank account or personal
check.

If you’ve any other Mac, Nintendo GB, GBC, GBA games or serious Mac
software you’d like to part with, let me know. I’ve also a few games I’m
wanting to sell, so mabe a trade could be worked out. Just ask for a
list.

Regards,
 Jamie Kahn Genet

If you’re not part of the solution, you’re part of the precipitate.

posted by admin in Uncategorized and have Comments (9)

How to link .o file build by "as" in xcode (with C file) ?

The "as" assembler was called in Terminal by

   as -L -n -static -o q_asm.o q_asm.s

and global declacred by

   .globl _func

q_asm.o is added to the project and func is declared in header by

   extern int func(int);

The linker complaint

   ld: warning prebinding disabled because of undefined symbols
   ld: Undefined symbols:  _func

I also try (from Terminal)

   ld -r -static -o q_asm.out q_asm.o

and I replace q_asm.o by q_asm.out but I got the same error message.

Next I try  (from Terminal)

   gcc-3.3 -x assembler -arch ppc -o q_asm.o q_asm.s

but I got thousand of syntax error (q_asm.s is a very large file).

I also try to install "Xcode Tools 1.1 Assembly Rule plug-in for Xcode 1.1"
I was able to link a small assemler file, but for q_asm.s I got the
same thousand of syntax error.

How to link .o file build by "as" in xcode (with C file) ?

posted by admin in Uncategorized and have Comment (1)

programming midi/quicktime on mac os 9 (actually 9.1)

Hi,

I would like to be able to access the musical instruments that are
part of Quicktime for mac os 9.1 (can’t remember which release of Quicktime –
I think 5 or 6). That is, I would like to execute procedures that play
various notes on various instruments. Imagine I’m about to try my luck at
music notation software for the mac (os 9.1). Does anybody out there know
where I could find documentation for this?

Another question (sorry for cheating) is, is there some documentation somewhere
about how to access/play the instruments/notes of some of the fancier
software synthesizers out there.

Thanks for ANY help.

Ken Quirici

posted by admin in Uncategorized and have Comments (2)