我有4个文件(2个标题,2个来源):
我在azt中包含了lcd。
在lcd中有一个函数WriteMsg
在azt中调用,
它工作正常。
但是当我在lcd.c中添加对此函数的调用时,我收到以下错误
Description Resource Path Location Type
unresolved symbol WriteMsg, first referenced in ./Includes/AutoZeroTracking.obj Joe1000 C/C++ Problem
我知道我首先在azt文件中引用它,但是在其他地方引用了这个函数,我没有这个问题。
这是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_ */
这是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_ */
azt.c中的代码
void DisplayAZT()
{
WriteMsg(AZT[m_curr_azt],AZTLen[m_curr_azt],0x8A,5);
}
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]);
}*/
}
提前致谢。
答案 0 :(得分:0)
我删除了内联并编译。