This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Combining C and C++ libraries

Former Member
Former Member

I'm a novice with STM32 and Keil.  I'd like to use a BMP280 C library and a RFM69 C++ library.  I wasn't able to understand how to use both in the same project.  Can someone share some advice/guidance?  The C++ library uses .hpp files and they were not recognized.  I was probably making a mistake.  Thank you in advance for any help.

Frank

Parents
  • here is how i do it and it works

    stmmxcube-> generate code for keil

    compile code in keil

    in keil-> right click main.c->options for file main.c->file type->c++ source file

    now you can add c++ header files and it will work

    when you regenerate code form stm cubemx repeat steps

    i generally add c++ files from arduino and make them compatable

    it works always

    some functions are still not supported

    currently c++17 is supported 

Reply
  • here is how i do it and it works

    stmmxcube-> generate code for keil

    compile code in keil

    in keil-> right click main.c->options for file main.c->file type->c++ source file

    now you can add c++ header files and it will work

    when you regenerate code form stm cubemx repeat steps

    i generally add c++ files from arduino and make them compatable

    it works always

    some functions are still not supported

    currently c++17 is supported 

Children