Hello. I am an experienced programmer (www.chc-3.com) but have run into
a problem I need help with. I am programming on my new Mac Mini after
many years on Wintel. I am using the latest OS X and Xcode versions. I
am trying to compile/link a small program that dynamically links to an
installed product (Lotus Notes). My code compiles just fine, but I
don't know how to get it to link. I don't think I need a Notes expert
(I am one) -- I need a Mac development expert who knows Xcode well. I
can send some $$ or a gift to someone who can talk me through this.
Chuck Connell
www.chc-3.com
Woburn, MA
781-939-0505
> I am trying to compile/link a small program that dynamically links to an
> installed product (Lotus Notes). My code compiles just fine, but I don't
> know how to get it to link.
Chuck,
Sounds like the compiler can find the appropriate header files, but the
linker can't locate the .dylib. There are (at least) two ways to make
Xcode link to a library:
- Project -> Add to Project, and point to the lib
- In the build settings, edit the linker flags: -L/path/to/lib
Did you try this?
What errors do you see in the build window (shift-command-b, make sure
you see _all_ panes, some are hidden by default!).
patrick
connell@chc-3.com - 26 Apr 2006 16:24 GMT
Thanks Patrick,
The error is "not a Mach-O file" when I add the file that I *think* is
the correct file to the project. It is not named .dylib but rather has
no extension. It is possible I am linking with the wrong file, or that
there is no dynamic library at all to link with. Notes API programming
to the Mac has been supported for years (although little used) so I
want to think that it is possible to do this link.
Chuck
Patrick Machielse - 26 Apr 2006 19:45 GMT
> The error is "not a Mach-O file" when I add the file that I *think* is
> the correct file to the project. It is not named .dylib but rather has
> no extension. It is possible I am linking with the wrong file, or that
> there is no dynamic library at all to link with.
I think the problem could be that the library you are linking to is an
old style Mac binary in the CFM format, and not an OS X native Mach-O
binary.
I'm not an expert on this subject, but I believe that Xcode can only
create Mach-O binaries. For PowerPC targets, it is possible to link to
CFM libraries. Since you are working on an Intel mini (I believe), it is
probably not possible to link to the the CFM binary, since CFM cannot
contain i386 code. You may be able to build a working Mach-O PPC only
binary that will work in Rosetta.
Maybe someone more versed in CFM can provide a more authorative
answer...
patrick
connell@chc-3.com - 27 Apr 2006 17:59 GMT
Thanks Patrick. I may pay for a support call to Apple about this.
Chuck
Patrick Machielse - 27 Apr 2006 19:09 GMT
> Thanks Patrick. I may pay for a support call to Apple about this.
Either that or call IBM, depending on where the problem lies.
You might also find an answer on the Apple Develper mailing lists:
<http://lists.apple.com/>
patrick
connell@chc-3.com - 26 Apr 2006 19:25 GMT
Yes, I did the first of these (add to project)
Chuck