views:

968

answers:

1

Hi; I am reading "Advanced Mac OS X Programming" by Mark and Aaron. I can't get one terminal statement to work correctly :

cc -g -o useadd -F./Adder/build -framework Adder useadd.m

It's on page 45 - Chapter 3 (Libraries). As you can see, I am trying to link useadd.m against a framework created using Xcode. When I run this command, I get this error :

ld: framework not found Adder

collect2: ld returned 1 exit status

I made sure that the folder /Adder/build exists under the current directory. Inside that folder, there is another one : Adder.build that contains the framework. I have been trying every possible combination, but the linker just can't find my framework.

I am using Mac OS X Leopard, and I think the book was published before Leopard, when Tiger was still the most recent Mac OS.

Can you help me please?

A: 

The path specified with the -F option has to point to a directory which contains the framework (not in a subdirectory). So try -F./Adder/build/Adder.build, if it's really in there. But usually Xcode puts build products in a directory name Debug or Release in the build dir. The Adder.build is only for intermediate build results.

Nikolai Ruhe
Hi, thanks, in general, it's important to make sure that the folder you specify through -F contains the framework (look for the .framework "extension")
MoonLight