This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Creating CCS v5 Static Library Project For MSP430
First step is to create a new CCS v5 project by selecting "File" -> "New" -> "CCS Project". Set the project name and most important, set the "Output Type" to "Static Library" as shown below.
Creating Static Library CodeThe next step is creating the static library code. Per default the CCS v5 Project will have main.c file in the project with main() function as shown as follows.
There are several things to be noticed when creating static library code:
The following example shows the implementation of "test_lib.lib" which contains two functions: increment() and addition(). The implementation of source code and header file is as follows
Compiling Static Library ProjectAfter finishing the code, make sure that the compilation succeeds and the library file is successfully created.
Example Application Using The Created Static Library
Creating CCS v5 Application ProjectThe application which uses the created library shall be implemented in separate project. The step is similar to the "Output Type" option shall be set to "Executable" instead of "Static Library".
Copying Library File and Library Header FileIn order to use the created library file, it shall be copied into the application project along the header file for the function declarations which are available inside the library file.
The following figure shows how copying of library and header file can be done in the application project by creating a specific folder.
Setting Application Compliation/Linking ConfigurationIn order to enable the application project referring to the included header and library file, the application compilation/linking configuration shall be adjusted.
First add the include path to the folder containing the library header file. This can be done by going to Project Properties ("Project" -> "Properties"), and select "Build" -> "MSP430 Compiler" -> "Include Options"
Then add the path to the library header file.
The next step is to include the library file in the linking process. This can be done in two ways:
Compiling Application ProjectAfter adjusting the application project configuration to include the library header file in compiling process and the library file itself in the linking process, the application project shall be able to be compiled successfully.
If the post helped solve your issue, please click on the 'This resolved my issue' button.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.