2014-02-28 05:19 AM
hi guys, i create a header file , means a .cpp and a .h file .
but when i attach this file in my project in IAR compiler , it doesn't work, i mean i cannot access to my class in header filehere is my code :SPI.h:&sharpinclude <stdint.h>&sharpifndef SPI_H_&sharpdefine SPI_H_class spi{ spi(int SPI_Num); void SPI1_Set(uint16_t ,uint16_t ,uint16_t ); void SPI2_Set(uint16_t ,uint16_t ,uint16_t );}; &sharpendifSPI.cpp: void spi::SPI1_Set(uint16_t spi_mode,uint16_t spi_direction,uint16_t spi_baudrateprescaler) { ...... }void spi::SPI1_Set(uint16_t spi_mode,uint16_t spi_direction,uint16_t spi_baudrateprescaler) { ....... } #master #spi #discovery #stm32f42014-02-28 06:24 AM
Hi
''it doesn't work, i mean i cannot access to my class in header file'' Please can you give the exact error from the compiler/linker? Your problem could be a number of things - we need the compiler/linker output to understand2014-02-28 06:29 AM
#include <spi.h>
in the .cpp ??