I'm trying to compile ichm on my Mac. It's a chm reader on Mac platform. The source code can be downloaded from here.
This project takes advantage of three other frameworks, namely chm_lib.framework, PSMTabBarControl.framework and Sparkle.framework. However, these three frameworks are not in the ichm repository, therefore you have to download it manually. The detaild URL and instructions can be found here. However, I would like to add some comments on how to build chm_lib framework:
The default SDK for ichm is 10.5. But when you're creating the framework for chm_lib, it will default to 10.6, and the default architecture is x86_64 and it's a debug version. Therefore, to make it right and make it be able to be linked against, it should be changed to "Release, i386". Otherwise, ichm will complain that the framework is not a right architecture.
At this phrase, I'm able to build the project successfully. Yes, you got that, there is always a 'but'. But it can't run. The loader can't find the Sparkle framework. To understand the whole story behind this, let's see how a typical Mac applications structures. Generally speaking, Mac application is a bundle of useful resources, it's just a directory containing all the stuff. Let me give you a rough idea.
You can see that the three lines that pointing to the framework from the output of otool. Otool on mac is similar with the 'ldd' command on Linux platform which lists all the dynamic libraries.
The default ichm project doesn't include copying the files. So we have to manually add these files. Choose "Project" -> "New Build Phrase" -> "New Copy Files Build Phrase". Then you'll see there is one more directory showing on "Targets".

Then you can just drag the frameworks into this directory. And "Build". Hopefully it should work fine then.
Recent Comments