This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to make .a library and put into the ses project

Hi Nordic:

                I want to make .a library, i use gcc to make .a library. And add .a library to my project. when i build the project , show build failed and the message is ".a: error adding symbols: File format not recognized". please help how to resolve this issue. Thank you

SDK: 14.2

IDE: SES v3.50

step1: use "gcc -c app_bcd2bin.c" to generate app_bcd2bin.o

step2: use "ar -cr libwfe.a app_bcd2bin.o" to generate .a

step3: put .a to my ses project

step4: include app_bcd2bin.h that i use the function.

step5: build the project

#include    "app_bcd2bin.h"


//=============================================================================
/*
  @brief		bcd2bin.

  @details		Binary Code Decimal

  @note		
  
*/
//=============================================================================
uint8_t		bcd2bin(uint8_t  bcd)
{
	uint8_t		buffer;

	buffer = (((bcd & 0xF0) >> 4) * 10) + (bcd & 0x0F);

	return	buffer;
}

//=============================================================================
/*
  @brief		bin2bcd.

  @details		

  @note			
  				
*/
//=============================================================================
uint8_t		bin2bcd(uint8_t  bin)
{
	uint8_t		buffer;

	buffer = (bin + (bin / 10) * 6);    

	return	buffer;
}

#ifndef	__APP_BCD2BIN_H__
#define	__APP_BCD2BIN_H__

//===========================================================================
//
//===========================================================================
#include    <stdbool.h>
#include    <stdint.h>
#include    <string.h>
#include    <stdio.h>
#include    <stddef.h>

//===========================================================================
//
//===========================================================================
extern  uint8_t		bcd2bin(uint8_t  bcd);
extern  uint8_t		bin2bcd(uint8_t  bin);
//===========================================================================		
//
//===========================================================================		
#endif 

                

Parents Reply Children
No Data
Related