


Yeah , never mind it was a dummy question, I was trying to get a program with modules compiled in c and in cpp :
uno.h :
<pre>
extern "C" {
int sum(int a , int b) ;
}
</pre>
uno.c
<pre>
int sum ( int a , int b ) {
return a + b;
}
</pre>
dos.cpp
<pre>
#include "uno.h"
int main (int argc , char ** argv ) {
int a = 9 ;
int b = 10 ;
int result = sum( a, b ) ;
printf ("Sum %d n", result );
return 0 ;
}
</pre>
WIth the keyword 'extern' and without the '#ifndef' of the h files(that I used in cpp before to transform int a C program) I could create the program successful.
Thanks Tom
never mind it was a dummy question:
uno.h :
<pre>
extern “C” {
int sum(int a , int b) ;
}
</pre>
uno.c
<pre>
int suma ( int a , int b ) {
return a + b;
}
</pre>
dos.cpp
<pre>
#include “uno.h”
int main (int argc , char ** argv ) {
int a = 9 ;
int b = 10 ;
int result = suma ( a, b ) ;
printf (“Suma %d \n”, result );
return 0 ;
}
</pre>
it works mixing the c and cpp modules to create one PGM


“Definition not found for symbol function1___”
Where is ‘function1___’?
Actually, that looks like a C++ name. Because your code shows this line:
…I’d assume that you actually are attempting to reference a proc in your C module and its real name is ‘function1()’. Right?
It’s hard to tell because it’s not clear what code you’re showing. I can’t tell what language it’s supposed to be.
Tom