cancel
Showing results for 
Search instead for 
Did you mean: 

Using the inline compiling macro ?

T J
Lead

I have an LCD is on an 8080 16bit FMC interface with A0 register select.

I can read the status correctly here:

#define LCD1_DEVICE_ADDR (uint32_t)0x60000000
#define LCD1_DEVICE_DATA (uint32_t)0x60000001
 
   uint16_t *pLcdRStatusWAddress = LCD1_DEVICE_ADDR;
   readLcdStatus = *pLcdRStatusWAddress;
 
 

All of these snippets are within one file,

//this compiles:
 
inline lcdRegDataWrite(uint8_t reg, uint8_t data) {
   *(__IO uint16_t*)LCD1_DEVICE_ADDR = reg;        
   *(__IO uint16_t*)LCD1_DEVICE_DATA = data;       
} 
 
//but this doesn't find it
 
   lcdRegDataWrite( 1 , 8);
 
>>> undefined reference to `lcdRegDataWrite'
 
 

13 REPLIES 13

Yes.

And you have compiled and linked this and it still threw the above error?

JW

T J
Lead

are you saying its not a syntax error, but a compiler issue ?

The compiler should resolve the internal links within one file, i.e. if the usage is after definition in the same file, it should be resolved within the compiler and the linker should never know about it.

Now I noticed you compile using gcc and link using g++; I don't say this may cause the problem but I found it strange. I don't use C++ so can't comment.

JW

T J
Lead

I use Visual Studio, it is an automated make.

I don't purposely run G++ C++ or anything in particular.

thanks for the support.