Log In    |    Knowledge Base    |    4D Home
Tech Tip: Replacing a Library in Codewarrior
PRODUCT: 4D Plugin Wizard | VERSION: 6.7 | PLATFORM: Mac & Win
Published On: September 28, 2001

There may come a time when creating or working on a project for a plug-in where a library that you are calling can no longer be found. Potential causes of this are that the library has been moved on the hard disk, the library has been accidentally deleted, or perhaps you have updated to a new version of Codewarrior and the library in question is no longer available and needs to be recompiled. The error you will receive from Codewarrior will usually be something similar to "Unable to find XXXLibrary." If you simply replace the library that is giving you trouble, the problem should be fixed.

The first step is to check and make sure the library your project is looking for actually exists on your machine. As we mentioned earlier, if you have updated to a new version of Codewarrior the library may not exist, or perhaps you received this project from a college and a library they used is not in the same location as yours so you may need to replace the library.

To find a library, you can use Sherlock on the Mac or a generic search engine on Windows. Simply type the name of the library you are trying to locate and perform a search. If your results are negative and the library does not exist, then you will need to see about rebuilding the libraries for Codewarrior. The project to rebuild all the MSL libraries can be found in "Metrowerks Codewarrior: MSL: (MSL_Build_Projects)". This one project will rebuild most of the MSL libraries and should rebuild any libraries you may need. One area of note is that the project listed above is for v6.0 of Codewarrior. Previous versions of Codewarrior may not have this build project.

If the library does exist then we can use it to replace the one in our current project. For our example, we are going to look at replacing the "MSL RuntimePPC.lib" project that is one of the default libraries that is created when the Plug-in Wizard generates a Codewarrior project.

As shown below, we have highlighted the MSL RuntimePPC.lib library in our Files tab of the Project.

Once highlighted simply drag the library to the Trash. This will remove it from the project. Now we can add this library back; to do so choose "Add Files…" under the Project window. This will bring up a dialog as shown below, which is requesting the file you wish to add to the project.

Simply navigate on your hard drive to the location of the library and click Add. This will add the new library to your project. Now all that needs to be done is move the new library to the same location as the library we deleted. To do so, simply click on the library and drag to the location you wish. You should now be able to recompile your project.