Mac OS X: Attempting to associate (ld) with a framework

I read "Advanced Mac OS X Programming" by Mark and Aaron. I cannot get one terminal statement to work correctly:

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

This is on page 45 - Chapter 3 (Libraries). As you can see, I am trying to associate useadd.m with a framework created using Xcode. When I run this command, I get this error:

ld: no frames found Adder

collect2: ld returned 1 exit status

I made sure that the / Adder / build folder exists in the current directory. There is another one inside this folder: Adder.build, which contains the framework. I try to use all possible combinations, but the linker simply cannot find my infrastructure.

I use Mac OS X Leopard, and I think the book was published before Leopard when Tiger was still the latest Mac OS.

Can you help me?

+3
source share
1 answer

The path specified by the -F parameter should point to the directory that contains the framework (and not in the subdirectory). So try -F./Adder/build/Adder.build if it is really there. But usually Xcode puts assemblies in the name of the Debug or Release directory in the assembly directory. Adder.build is for intermediate build results only.

+4
source

Source: https://habr.com/ru/post/919897/


All Articles