I would like to create Win32 application with GUI in cpp-files and main logic in c-files. Things are ok until c-function, called within c++ code with CreateThread, for example open COM port. I got IDE hanging in C++ Builder and error in CodeBlocks+GCC.
A:
Explain more about your error, put the console log here and also post your code to let us think in your problem to solve it as fast as we can and help you to continue your project. Thanks.
Nathan Campos
2009-10-25 23:35:59
+1
A:
Since you didn't say much about the problem, I'll take a guess:
Maybe your C headers don't have an extern "C" { ... }
?
C++ FAQ lite gives more details.
Artelius
2009-10-25 23:53:40
A:
Many thanks. Now all is working fine. My mistake was that I tied C and C++ code by writing in cpp-file this lines:
extern "C" {
#include "Klnmain.c"
}
When I had created h-file with declaration of exported from C to C++ C-functions and variables, common for c-files and cpp-files, and had written
extern "C" {
#include "Klnmain.h"
}
in cpp-files, problems have dissappeared. :-)