I have one CPP file with serial port data transfer win32 API's and another set of C files having basic calculations(Image processing). I would like to compile these files in one project and build an exe. But its not possible. I tried many ways.
simply called the CPP file as a function and tried to compile. That was not working.
Then renamed all C files to CPP(since C files had only basic calculations) and then tried to compile. It was showing errors to some extern variables and so on.
What I would like to know is- is there any settings to be done to the compiler to compile mixed C and C++ files in one project??
you mean by convert: use some tool that convert the code automatically? I really don't know but I think taht if you're matlab code is running it's so easy to make a C++ code based on matlab one!
regarding problem with C and C++ I can not realize why you could not compile them together. but you may find this helpful: convert file written in c++ to a dll file and load it in those c files and used it.
regarding MATLAB and C++, you can write a function in matlab and use COM to create a COM object and use it in c++. BUT I myself cannot use it. there is a help in Mathwork about using COM objects.