Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Mixing C and C++ files (windows with MinGW compiler)
Re: Mixing C and C++ files (windows with MinGW compiler) [message #10150 is a reply to message #10129] |
Fri, 22 June 2007 07:27  |
waxblood
Messages: 95 Registered: January 2007
|
Member |
|
|
In a cpp file you have to wrap all C functions prototypes (or include) statements with this block:
extern "C" {
}
in your example the correct form is:
---------- main.cpp ------------------------------
extern "C" {
void __cdecl GetHello(char *Text);
}
Hello::Hello()
{
char HelloText[12];
CtrlLayout(*this, "Window title");
GetHello(HelloText);
lblHello = HelloText;
}
GUI_APP_MAIN
{
Hello().Run();
}
Ciao,
David
|
|
|
Goto Forum:
Current Time: Sun Jul 06 13:20:36 CEST 2025
Total time taken to generate the page: 0.04053 seconds
|