How to use module data from c++

How to use module data from c++

liuxiaofeng's picture

Hi,
I write a dll with fortran90.In the dll,I defined
a module to communicate and store data.The dll was called
by my VC++ application.But when I wanted to refer the data
in the module, Link error occured!!!
I followed the Help in the Online document,and the code
like this:
!in F90 file
MODULE EXAMP
REAL A(3)
INTEGER I1, I2
CHARACTER(80) LINE
TYPE MYDATA
SEQUENCE
INTEGER N
CHARACTER(30) INFO
END TYPE MYDATA
END MODULE EXAMP

!in my VC++ application
extern "C" float EXAMP_mp_A[3];
extern "C" int EXAMP_mp_I1, EXAMP_mp_I2;
extern "C" char EXAMP_mp_LINE[80];
extern "C" struct {
int N;
char INFO[30];
} EXAMP_mp_MYDATA;

when linking,Error 2001 occur.
error LNK2001: unresolved external symbol _EXAMP_mp_I1
error LNK2001: unresolved external symbol _EXAMP_mp_I2
error LNK2001: unresolved external symbol _EXAMP_mp_A
.......

Why???
and why we should refer the data like that "EXAMP_mp_A"?

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.