cancel
Showing results for 
Search instead for 
Did you mean: 

C++ library with STM32CubeMX ?

antonius
Senior

Dear Members,

Is it possible that I combine C language generated from STM32CubeMX with

C++ library ?

Any examples ?

Thanks =)

4 REPLIES 4
Piranha
Chief II

Usually C++ code is put in separate *.cpp/*.hpp files. Add those files to the project and call their functions from C code.

antonius
Senior

I did that, but I can't compile with .cpp after I put --cpp on my compiler, it gave me a lot of errors, I use Keil for compiling.

What should I change to make it compatible between C and C++?

0690X000009YDEAQA4.jpg

Pavel A.
Evangelist III

> it gave me a lot of errors

Which errors? No need to use --cpp, Keil's compiler will detect c++ file by .cpp extension.,

By the way, which Keil compiler are you using: V5 (armcc) or V6 (clang-like) ?

-- pa

I use uVision V5.26.2.0