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

Compiling dll in ifort vs visual studio


I'm trying to compile a dynamic library in VS2010. I've already tried compiling it with ifort using multiple compile lines for lowest level source files to highest level. Everything compiled fine but I did get one warning at the end:

LINK: warning LNK4098: defaultlib 'LIBCMT' conflicts with the use of other libs; use /NODEFAULTLIB:library

Nevertheless I think that the dll has compiled OK.

Next I tried to move all the source files to visual studio. I enabled preprocessing because my source files do contain some directives. Unfortunately when I try to build the solution I get an error for one of the subroutines at an intermediate-level source files:

Error 1 error #6633: The type of the actual argument differs from the type of the dummy argument.   [1.]
After which it aborts the compilation. Please note that I simply imported all my source files under the Source Files directory in my VS2010 project, enabled /fpp and pressed "Build". Does the user also need to specify the compile order in Visual Studio or is this handled automatically? Why am I getting a type error in VS when the exact same source files compile just fine in ifort? Thanks for your help.



0 Kudos
2 Replies
Black Belt

If each source file is compiled separately and all the resulting .OBJ files linked to produce the DLL, mismatched arguments will be detected only if the called subprogram and the lines with the calls to it are in the same source file. You should investigate and ensure that the mismatch is safe ignore, or fix the error. 

The reason that you obtained different behavior with VS is that the compiler options in effect were different than when you compiled at the command line. There are menu items in VS in which you can find the effective options; you can also find that information in the build log file.



for the subroutine that gives the error verifies the conversion or equivalence of the type of data of ifort and VB