Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
waxblood is currently offline  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
 
Read Message
Read Message
Previous Topic: A trouble with "All static" linking on Linux
Next Topic: shared libraries for debug, static for release ?
Goto Forum:
  


Current Time: Sun Jul 06 13:20:36 CEST 2025

Total time taken to generate the page: 0.04053 seconds