Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Problem using exported method via .obj file

$
0
0

I have a dll project p1 that has a source file p1.for that exports one subroutine

SUBROUTINE P1()
      IMPLICIT DOUBLE PRECISION(A - H,O - Z)
      !DEC$ATTRIBUTES DLLEXPORT :: P1
      !DEC$ATTRIBUTES ALIAS:'P1' :: P1
      RETURN
END

After building, it will produce p1.dll, p1.lib and p1.obj.

Now I have another dll project p2, that has p1.obj as Additional Dependency.

In p2.for I make a call to P1().

For this I get a linker error 

error LNK2019: unresolved external symbol _p1 referenced in function _p2    p2.obj    

If I comment out the DLLEXPORT part in P1, the p2 project builds without errors.

 

Is this a feature, and how I can have P1 exposed from dll and also used via .OBJ file? One way is making a wrapper method P11() that would not be exported, and I would call that one from p2.

 

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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