Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Converting Mixed C/Fortran from MSV2008 to MSV2012, C2065 errors

rdees
Beginner
359 Views

I'm in process of converting from Microsoft Visual Studio 2008 to MSV2012 for my mixed code, C and FORTRAN application.

The code compiles and executes perfectly for MSV2008 but I receive many, many error messages for the C portion of my code

when I try to compile using MSV2012 wrapper.

The compiler does not like the line:

int _stdcall OPEN_MATLAB(name,ll)

The first couple of error messages are :

1>Source\matlab.c(38): error C2065: 'name' : undeclared identifier

1>Source\matlab.c(38): error C2065: 'll' : undeclared identifier

I've imported all the project properties from MSV2008 into MSV2012, and, I've compared all the compiler flags.

The flags appear to be the same in both MSV2008 and MSV2012. I'm guessing that MSV2012 needs to have some

compiler flag set, so that it is doing the same thing that MSV2008 was doing for me.

I'm a FORTRAN programmer that has inherited this C code (i.e. I don't know C very well). Any help would be greatly

appreciated.

Here's what the code looks like:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#include "stdio.h"

#include "string.h"

#define DATASIZE float

#define ISIZ int

typedef struct

{

ISIZ type;

ISIZ mrows;

ISIZ ncols;

ISIZ imagf;

ISIZ namlen;

ISIZ name;

}Fmatrix;

FILE *fp;

int _stdcall OPEN_MATLAB(name,ll)

char name[];

int ll;

{

fp = fopen(name,"ab");

if (fp != NULL)

return(0);

else

return(1);

}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

0 Kudos
1 Reply
TimP
Honored Contributor III
359 Views

Did you set your project to use Intel C++ rather than Microsoft compiler in both cases?  If you are using Microsoft C++ it may be difficult to get an answer here.  Your question pertains to matlab so you may not find the right experts here.

If you are changing between 32- and 64-bit mode, you may need corresponding source code changes.  _stdcall became obsolete 15 years ago.

0 Kudos
Reply