04-01-2024, 11:16 AM
Hello,
I will use in my project the skeleton, which is created from ST Micros Cube MX, it is native C-code With a switch with
I go on to programm in C++. The compile process seems to be good. But the linker mentioned during linking the object files problems like "unknown synthax". My thought are going in the direction, the compiler for C is the gcc, for C++ it is g++. Because of this, the linkersymbols are probably not matching.
My question is, how can I use the g++-compiler within embitz always for the C-Code (without rename main.c to main.cpp)? Is this possible? Or is it a completely different reason behind? Maybe, I have not considered all points from here ( How to mix C and C++, C++ FAQ (isocpp.org)) But for now, I see no other solution.
Thanks,
Jan
I will use in my project the skeleton, which is created from ST Micros Cube MX, it is native C-code With a switch with
Code:
#ifdef __cplusplus
extern "C" {
#endif
// all of your legacy C code here
#ifdef __cplusplus
}
#endif
I go on to programm in C++. The compile process seems to be good. But the linker mentioned during linking the object files problems like "unknown synthax". My thought are going in the direction, the compiler for C is the gcc, for C++ it is g++. Because of this, the linkersymbols are probably not matching.
My question is, how can I use the g++-compiler within embitz always for the C-Code (without rename main.c to main.cpp)? Is this possible? Or is it a completely different reason behind? Maybe, I have not considered all points from here ( How to mix C and C++, C++ FAQ (isocpp.org)) But for now, I see no other solution.
Thanks,
Jan