Usually a dylib is linked to an executable at compile time, I think you
should try to compile a "bundle", that's a better equivalent of DLL.
Another issue: I'm not sure Excel is able to load Mach-O files. If you
look
at "Solver Library" for example, it's a PEF file.
Thanks for your answer,
I tried bundle file, but it does not solve the problem.
I did see in the helpsection of the declare statement und vba for
applications mac, that they deal with shared libraries, I thought they are
talking about .dylib files.
The Mach-O file, does it correspond to the static link option in the Xcode
tool.
Which application type does correspond to this under Xcode 1.5 : BSD
application, shell tool, shared lib?
I looked at Excel help, and it seems to me that they are talking about PEF
files ("code fragment" and "resource" usually refer to Apple CFM and old
binary format).
Little explanation: MacOS 9 used double-fork files for programs as well as
"user" files, to store data and resources in the same file (hence the
"data
fork" and the "resource fork"). When you read first bytes of the data fork
of an executable file, you get "Joy!peffpwpc". And These are PEF files.
OSX has completely changed this, and uses Mach-O binary files (and files
don't use 2 forks anymore - it's supported, but discouraged).
If you look closely at an Apple application, it's a folder: you can open
it
with right-click and "Show Package Contents". Inside this folder, you'll
find usuall an executable file in the Mach-O format, and resource files
(and
sometimes libraries, etc...). And when you read first bytes, you get "fe
ed
fa ce" in hex dump.
OSX has still support for CFM (Code Fragment Manager) applications.
Indeed,
many carbon applications can run under both OS9 ans OSX. But XCode can
only
compile Mach-O, for one simple reason: it uses gcc as a compiler, an gcc
(under OSX) can only produce Mach-O executables.
I looked at several files of Office, and they are all PEF files (including
the Excel program). And if you look at folder /System/Library/CFMSupport/,
you should find CarbonLib and StdCLib (among others), put there when you
installed Office. So I think I can conclude Office is a carbon
application,
using the old CFM "model". But note Carbon applications can also be
compiled
in Mach-O apps, it's just a design choice. And I am almost certain you
will
need to compile CFM dynamic libs to be able to load them in Excel.
As I said above, XCode cannot do that. I suppose CodeWarrior can. And MPW
under OS9 certainly can.
If you have only OSX, Xcode and Office, I fear it's bad luck ;-)
But if you find a solution, I am interested ! I would be very happy to
compile dylibs for Excel...
---
So far I am using xlc++ as compiler. This is much more compatible with the
windows ms VC++ code.
If I have to I will try Code Warrior. If I understand you right, I have to
change my linking. The .o files should be
the same in both cases, Mach-O and CFM.
Is it possible to have CFM build under OS X or do I have to change to an
OS 9 operating system ?
If XCode does not allow to build CFM files. Is this possible by simple
makefiles and the dyld linker ?
how can I analyze a PEF file ? I tried with otool, buth I think this is
not the correct one.
Regards
Jurgen