Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

Extension of source file (.c .cpp) affects how it is compiled??

$
0
0

Hello,

New in using Intel C++ compiler here. I have an example C file listed below which illustrates the problem. There is no main function in the source by the way.
============================================
#include
struct abc {
int i,j;
} ia;

void f1(struct abc t) {
printf("%d %d\n", t.i, t.j);
}

void uf3(void)
{
f1(ia);
}
============================================

When the file is named as, for example, myfile.cpp,it compiles (cntrl+F7) fine. But when I called it myfile.c, then I have the following error
>>>>>
Error (active) argument of type "struct abc" is incompatible with parameter of type "struct abc" ..... ..... 12
>>>>>
Line 12 is f1(ia);

I am using Intel Parallel Studio XE Professional Edition for Fortran and C++ Windows 2016 together with Microsoft Visual Studio Community 2015.
Any help would be much appreciated. Thank you very much.

HCL


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>