Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mixed Code C/C++
#1
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 

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
Reply


Messages In This Thread
Mixed Code C/C++ - by harry71 - 04-01-2024, 11:16 AM
RE: Mixed Code C/C++ - by embitz - 04-01-2024, 06:17 PM
RE: Mixed Code C/C++ - by embitz - 04-01-2024, 06:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)