Re: Link problem with Compaq Visual Fortran

From: Robert Yu (tyyu_at_ncnu.edu.tw)
Date: 10/07/03


Date: 6 Oct 2003 20:32:24 -0700


"Jugoslav Dujic" <jdujicREMOVE@uns.ns.ac.yu> wrote in message news:<blrdr4$fiqqb$1@ID-106075.news.uni-berlin.de>...
> Robert Yu wrote:
> | Dear All:
> |
> | I am using the MicroSoft Visual Studio 6.0 under Window XP for a
> | project,
> | and my friend sent me a library (also created by Microsoft Visual
> | Studio),
> | yet one of the source codes is a Fortran program. He used Compaq
> | Visual Fortran
> | to compile the Fortran and C into a library. When I try to link this
> | library,
> | I first got some message saying some libraries are missing (ex: can
> | not find
> | dfor.lib, dfconsol.lib ...), in order to compile the entire project, I
> | got
> | those missing libraries. Yet, when I compile them again, I have the
> | following errors:
> |
> | dfor.lib(matherr.obj) : error LNK2005: __matherr already defined in
> | msvcrtd.lib(merr.obj)
>
> This is known as "Multiple C library syndrome". The cause is mismatch
> in Fortran and C run-time libraries (CVF uses both despite the fact
> that you might not have a single line of C within your program).
>
> One solution is to match libraries on "Fortran/Libraries" and
> "C++/Libraries" of Project Settings dialog. Make sure that these
> are the same, and that they match the setting used when the .lib
> file was compiled (usually, "Single-threaded", but you have to
> experiment). A better solution is to ask your friend to compile
> the .lib with /libdir:noauto switch (Project Settings/Fortran/
> Libraries category/Disable default library search rules check box).
> This setting says: "Don't write into this .lib information which
> run-time libraries to link with; use whatever is linked with
> 'parent'." I feel this switch should be on by default for static
> libraries, but CVF AppWizard does not do it.
>
> For more information, see (the second part of):
>
> "Visual Fortran/Visual C++ Mixed-Language Programs" in Mixed-language
> section of Programmer's guide
>
> as well as the original MCLS article in CVF Newsletter:
>
> http://h18009.www1.hp.com/fortran/visual/vfn10/page2.html
>
> Intel/CVF user's forum is located at:
>
> http://intel.forums.liveworld.com/forum.jsp?forum=76

Dear Jugoslav:

  Thanks for your help.

  I have make both the same run-time libraries, and it seems the
original problem solved.
Yet, the other problem occurs: The following is the list of the error
message:

GCG.lib(ly.obj) : error LNK2001: unresolved external symbol __FIsqrt
GCG.lib(ly.obj) : error LNK2001: unresolved external symbol __FIlog
GCG.lib(ly.obj) : error LNK2001: unresolved external symbol
_for_write_seq_lis
GCG.lib(ly.obj) : error LNK2001: unresolved external symbol
_for_write_seq_lis_xmit
GCG.lib(ly.obj) : error LNK2001: unresolved external symbol __FIIfexp_
GCG.lib(ly.obj) : error LNK2001: unresolved external symbol __FIcos
GCG.lib(ly.obj) : error LNK2001: unresolved external symbol
_for_write_seq_fmt
GCG.lib(ly.obj) : error LNK2001: unresolved external symbol
_for_write_seq_fmt_xmit

I check the Fortran file, and I notice the sqrt, log are used, but I
did not know where to
add the include files (as the C/C++ can add the math.h) for these
functions. Also, I did not
have any clue for "for_write_seq_lis" or "for_write_seq_lis_xmit" ...
Can you give me some more hints? Thanks.

Robert



Relevant Pages

  • Link problem with Compaq Visual Fortran
    ... yet one of the source codes is a Fortran program. ... to compile the Fortran and C into a library. ... I first got some message saying some libraries are missing (ex: ... dfor.lib: error LNK2001: unresolved external symbol ...
    (comp.lang.fortran)
  • Re: linking error
    ... I'm trying to link  three codes in fortran 90 by using compaq visual ... TEST_2REAC.OBJ: error LNK2001: unresolved external symbol ... in the project too and add the libraries to the link step for your ...
    (comp.lang.fortran)
  • Re: Matlab Vectorisation Speed - How is it done in c++?
    ... Beating the performance of vectorized Matlab code is very ... Matlab makes calls to optimized C and Fortran libraries ... Use optimization level 3 on numerical code and level 2 on non- ...
    (comp.soft-sys.matlab)
  • Re: can somebody verify this C program which calls dsaupd_ ? (longish)
    ... >>>(terribly sorry for this long post which includes my two source files, ... > is NOT relevant to FORTRAN language newsgroup. ... More importantly, if your libraries compiled correctly, they were fine. ... > FORTRAN libs. ...
    (sci.math.num-analysis)
  • Re: C versus FORTRAN90
    ... FORTRAN90 version of these libraries. ... Are there other more subtle benefits for FORTRAN over C? ... If the answer to if f95 heavy, then maybe some sort of cost-benefit analysis of a wholesale switch from f95 to C at your company should be done to convince them otherwise. ...
    (comp.lang.fortran)