Search code examples
cmsp430

unresolved symbol , first referenced in


I have 4 files (2 headers, 2 source):

  • lcd.h,
  • lcd.c,
  • azt.h and
  • azt.c

I included lcd inside azt.

In lcd there's a function WriteMsg which is called inside azt, it works fine.

But when I add a call to this function in lcd.c, I get the following error

Description Resource    Path    Location    Type
unresolved symbol WriteMsg, first referenced in ./Includes/AutoZeroTracking.obj Joe1000         C/C++ Problem

I understand that I referenced it first at azt files, but this function is referenced in other places and I don't have this problem.

Here's the lcd.h:

#ifndef MSP
#define MSP
#include <msp430g2553.h>
#endif
#include "Utilities.h"
#include "Declarations.h"

#ifndef INCLUDES_LCD_H_
#define INCLUDES_LCD_H_
#define LCD_CALL 1

void InitLCD(unsigned char SDA,unsigned char SCL,unsigned char slaveAddress);
void StartLCD();
inline int ReadyToSend();
void SendToLcd(unsigned char* data, int size);
void WriteToLCD(int clearScreen);
void switchFrom8To4Bits();
void write2x4Bits(unsigned char bits, int is_data);
void writeCommand(unsigned char command);
inline void writeData(unsigned char data);
void ClearScreen();
void WriteWeight();
void WriteWeightMode();
inline void WriteMsg(const char* msg, int msgLen,char msgLocation,int maxDigits);
inline void WriteNum(long num,char location,int maxDigits);
void WriteTare(char num);


#endif /* INCLUDES_LCD_H_ */

here's the azt.h:

#ifndef INCLUDES_AUTOZEROTRACKING_H_
#define INCLUDES_AUTOZEROTRACKING_H_
#include "Declarations.h"
#include "LCD.h"
#include "Utilities.h"

void AZTSetup();
void AZTProcess();

void DisplayAZT();

void GetPreviousAZT();
void GetNextAZT();

void KeyPressedAZTMode(char keyPressed);

inline char HasAZTStopped();

#endif /* INCLUDES_AUTOZEROTRACKING_H_ */

the code in azt.c

void DisplayAZT()
{
    WriteMsg(AZT[m_curr_azt],AZTLen[m_curr_azt],0x8A,5);
}

the call in lcd.c

void WriteWeight()
{
    WriteNum(CountBy[cnt_by_idx],0x80,2);
    WriteNum(NOD[n_o_d_idx],0x83,5);
    WriteNum(max_weight,0x89,6);
    WriteNum(idx_decimal_point,0x90,1);
    WriteMsg(AZT[az_tracking_idx],AZTLen[az_tracking_idx],0x9A,3);
    WriteNum(BaudRate[baud_rate_idx],0xC0,6);
    WriteNum(PP2Z[percent_p2z_idx],0x9E,2);
    WriteNum(wt_zero,0x94,10);
    WriteNum(wt_slope,0xD4,10);

    /*int i = 0;
    for(i = 0; i < WEIGHT_ARR_LEN ; i++)
    {
        if(display_weight[i] != IGNORE_CHAR)
            writeData(display_weight[i]);
    }*/
}

Thanks in advance.


Solution

  • I removed the inline and it compiles.