- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes. This matches the Microsoft (cl) compiler.
If you want to avoid this you can use these options:
/Tc<file>
compile file as C source
/Tp<file>
compile file as C++ source''
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Judy, didn't spot these 2 options!!
HCL

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page