[vtkusers] VTK and MacOSX
William A. Hoffman
bill.hoffman at kitware.com
Fri Apr 27 12:51:02 EDT 2001
There is a section in vtkDynamicLoader.cxx for the MAC, but
perhaps the ifdef is incorrect. We don't have a MAC here at Kitware,
but here is the code:
// ---------------------------------------------------------------
// 2. Implementation for the Power PC (MAC)
#ifdef __powerc
#define VTKDYNAMICLOADER_DEFINED 1
#include <CodeFragments.h>
#include <Errors.h>
#include <Threads.h>
#include <Timer.h>
vtkLibHandle vtkDynamicLoader::OpenLibrary(const char* libname )
{
Str63 libName;
libName[0] = strlen(libname);
strcpy((char*) &libName[1], libname);
ConnectionID connID;
Ptr mainAddr;
Str255 errName;
OSErr err = GetSharedLibrary(
libName, kPowerPCArch, kLoadLib, &connID, &mainAddr, errName
);
return err == fragNoErr ? connID : 0;
}
int vtkDynamicLoader::CloseLibrary(vtkLibHandle lib)
{
return 0;
}
void* vtkDynamicLoader::GetSymbolAddress(vtkLibHandle lib, const char* sym)
{
Str255 symName;
symName[0] = strlen(sym);
strcpy((char*) &symName[1], sym);
Ptr symAddr;
SymClass symClass;
OSErr err = FindSymbol(lib, symName, &symAddr, &symClass);
return (void*) symAddr;
}
const char* vtkDynamicLoader::LibPrefix()
{
return "";
}
const char* vtkDynamicLoader::LibExtension()
{
return ".lib";
}
const char* vtkDynamicLoader::LastError()
{
return 0;
}
#endif
If you implement that section, it should work. It is falling through all the
ifdefs to the default unix machine which includes dlfcn.h.
I can help you off the list if you have problems.
-Bill
At 08:38 AM 4/26/2001 -0500, Joey Mukherjee wrote:
>What is the status of VTK and MacOSX?
>
>I am using Tenon's XTools (which is a great package compared to any of the tools
>I've tried for Windows) to convert our Unix/Motif stuff over to Mac.
>
>Most of VTK compiles right out of the box, but the one routine that does not is
>vtkDynamicLoader.cxx. It can't find dlfcn.h.
>
>Is there a way to disable the dynamic loading in VTK or is there a way to make
>this function compile?
>
>Thanks!
>
>Joey
>
>+--------------------------------------------------------------------------+
>+ Joey Mukherjee +
>+ joey at swri.org "The price of freedom is eternal +
>+ vigilance, or $12.50 as seen on +
>+ http://www.space.swri.edu/~joey EBay... +
>+ +
>+--------------------------------------------------------------------------+
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list