cannot call a class from my own header file
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-28 5:19 AM
Posted on February 28, 2014 at 14:19
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 #stm32f4
Labels:
- Labels:
-
SPI
-
STM32F4 Series
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-28 6:24 AM
Posted on February 28, 2014 at 15:24
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 understandOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-02-28 6:29 AM
Posted on February 28, 2014 at 15:29
#include <spi.h>
in the .cpp ??