library problem

library problem

Hello everyone,

I hope that I am at the right forum for my problem.

I am using Microsoft Visual Studio 10 express and Compaq Visual Fortran 6.

My problem is the following : I have to compile a *.c file that calls a *.f file. The fortran file have been compiled previously with CVF6.

First I had a message telling me that MVC10 couldn't find the libc.lib file, so I gave the path and this is ok.

Now I have a problem of compatibility of libraries : LINK:warning LNK4098:defaultlib 'LIBCMT' conflicts with use of other libs;use NODEFUALTLIB:library.

What should I do? I've read some things on the net but it is not really clear to me.

How can I know which library used CFV6 for compiling the fortran file? How can I impose CFV6 to use another one, compatible with the one used by MVS10?

Thank you for your help and please redirect me to the right forum if I'm not.


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

 libc.lib is the static, single-threaded library from Visual C++ Microsoft removed it in VS2005. The C++ code you build with VS2010 won't work with the old libc. The only thing I can think of is to have the linker ignore libc.lib and try linking to the newer libraries in VS2010.

Retired 12/31/2016

Hi Lionel,

Thank you very much for your answer. How can I do that? I can't find on internet the prompt comands for compiling my fortran file and tell him to ignore libc.lib and link to the new libraries. I am trying to find a free software for compiling fortran, that maybe would use more recent libraries. 


You use the /nodefaultlib:libc.lib option when linking. The other thing you can do is compile the Fortran with the /Zl optionbut then you will need to explicitly add CVF's dfor.lib to the list of libraries to be linked to.

Retired 12/31/2016

Hi Steve,

thank you again for helping me.

I explain you the whole context, it can be of help.

I am working with the CFD code FLUENT. I need to use UDF (User Defined Function). For classic situation (UDF written in C), it is all ok. I just have to write in a user_nt.udf file (from fluent), the name of my udf.c and it's ok for compiling with MVS10. If a user needs a UDF including fortran parts, he has to add it in this user_nt.udf file :USER_OBJECTS =$(SRC)Debug\toto.obj

When I did that I had several messages that some files were not found, so I add them :USER_OBJECTS =$(SRC)Debug\toto.obj $(SRC)Debug\dfor.lib $(SRC)Debug\libc.lib $(SRC)Debug\dfconsol.lib $(SRC)Debug\dfport.lib, and this solved this problem but arrised the one about the libraries conflict.

So, I tried to compile the fortran program through the prompt window, typing : f90 /Zl toto.f and got :dfor.lib<DFORMAIN.obj> : error LNK2001:unresolved external symbol _MAIN_. I don't really know the prompt commands with CVF6 since I've always used it through the graphical interface. SO I don't know how to give the path to the dfor.lib.

In the other way, if I compile it normally and use the /nodefaultlib:libc.lib option in the MVS10, I have the following error message (same, I don't really know where I should put this  /nodefaultlib:libc.lib, after nmake or in the makefile? ) when typing nmake /nodefaultlib:lib.c:

NMAKE : fatal error U1073:don't know how to make nodefaultlib:libc.lib

I am really new to this kind of problems and I know very few about programming using the prompt windows.

 Thank you in advance.


It seems unlikely that Fluent would still be supporting linking user functions built with CVF, certainly not in a version which is compatible with VS2010, in part because there has been no vendor support of CVF for 10 years.

Hi TimP,

Thanks for your reply. So I need to find another fortran compiler!


You need a Fortran compiler compatible with the one used for building your Fluent.  Fluent documentation should suggest the  versions they have tested for compatibility.  They certainly have available versions built with recent Intel ifort compilers.

ok, so no way to obtain something ok giving options when compiling? my problem is that I need to find a free compiler.


my problem is that I need to find a free compiler.

I think that a bigger problem is that you have not identified the capabilities that the compiler should support in order to be callable from your old version of Fluent. Intel Fortran can build a DLL with a CVF interface, with some limitations, with the /iface:cvf option. Whether that will work with Fluent is something that you will have to investigate. You will probably find all the requirements listed in the Fluent documentation for your version of Fluent.

Show us how you would do this in C including a sample C file and this udf file. I am pretty sure you can make it work with CVF. Why does it have to be free?  CVF wasn't free. We offer very attractive student licensing for Intel developer tools.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today