I am writing C++ code. I plan to call the main function from "transform.c" , but the problem is that "transform.c" is written in c , converting in C++ would introduce a ton of errors. So is there any "transform.cpp" that I can use , I'm having a lot of trouble with the C API , so I thought I could just do this .
Asked
Active
Viewed 43 times
0
-
lets try with `extern C` : https://stackoverflow.com/questions/1041866/what-is-the-effect-of-extern-c-in-c – long.kl Mar 07 '22 at 08:58
1 Answers
0
use extern "C"
extern "C"{
// c code
// include copy code from transform.c and put here
// or create new transform.cpp and #include "transform.c"
}

long.kl
- 670
- 4
- 12