Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Sharing data in dlls

pashmak
Beginner
346 Views

Dear All,

I know it is very simple but I am confused about it. I am going to create a module which holds all my shared variable and import this module in different subroutines in different dlls. How I can export the variables of a dll and how I can import these variables into different dll?

Many Thanks,

Reza

0 Kudos
1 Reply
Steven_L_Intel1
Employee
346 Views

One key is that when the DLL containing the shared data is linked, you have to add the linker option /section:.data,rws

I have attached an example project that uses this feature.

0 Kudos
Reply