linker mistakes entry point in dll

From: Robert Oeffner (robertNoJunk_at_oeffner.spam_me_not.net)
Date: 01/28/05


Date: Fri, 28 Jan 2005 08:22:46 GMT

Hi,
I'm using intel fortran version 8 from the command line compiling a project
in a makefile using microsoft nmake utility. The program is supposed to be a
dll but the problem I have is that the linker always gets the wrong entry
point and atempt to compile it as a standalone executable. I believe I have
specified the right flags in the makefile but from the output it seems that
the linker still tries to look for a function MainCRTStartup (rather than
DllMainCRTStartup) and then complains when it can't ind it. I am certain
none of the source code refers to a main program.

If anybody has a clue as which flags to set in my makefile that would be
great.

Here is an excerpt of the output from nmake:

C:\Users\Oeffner\GminAtHome\F77\GminNew>nmake /f makefileDLLIntel

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

ifort.exe /c -Od -Zi -Oy- /4L132 /4Yportlib /debug:full /pdbfile centre.f
submain.f mcruns.f morse.f
.
.
(more source files)
.
.
Intel(R) Fortran Compiler for 32-bit applications, Version 8.1 Build
20040802Z Package ID: w_fc_p_8.1.018
Copyright (C) 1985-2004 Intel Corporation. All rights reserved.

mind.f(487) : Warning: Because of COMMON, the alignment of object is
inconsistent with its type [PCOM]
      DOUBLE PRECISION MFUNC, PCOM, X, XICOM

ifort.exe -DDEFLJ -DDEFLJPB -DDEFLJPS /c -Od -Zi -Oy- /4L132
/4Yportlib /debug:full /pdbfile mc.fpp mylbfgs.fpp io1.fpp k
eyword.fpp ddfpmin.fpp finalio.fpp potential.fpp dftb.fpp cgmin.fpp
Intel(R) Fortran Compiler for 32-bit applications, Version 8.1 Build
20040802Z Package ID: w_fc_p_8.1.018
Copyright (C) 1985-2004 Intel Corporation. All rights reserved.

ifort.exe /FegminIntel.dll centre.obj submain.obj mcruns.obj morse.obj
quench.obj rad.obj dprand.obj report.obj saveit.obj seed.obj
.
.
(more source files)
.
.
lj.obj ljpbin.obj ljpshift.o
bj BLJcluster.obj /link -entry:_CRT_INIT
Intel(R) Fortran Compiler for 32-bit applications, Version 8.1 Build
20040802Z Package ID: w_fc_p_8.1.018
Copyright (C) 1985-2004 Intel Corporation. All rights reserved.

Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

-out:gminIntel.dll
-subsystem:console
-entry:mainCRTStartup
-entry:_CRT_INIT
centre.obj
submain.obj
.
.
(more objectfiles)
.
.

mcruns.obj
ljpshift.obj
BLJcluster.obj
   Creating library gminIntel.lib and object gminIntel.exp
LINK : error LNK2001: unresolved external symbol __CRT_INIT
libifcore.lib(libifcoremain.obj) : error LNK2001: unresolved external symbol
_MAIN__
gminIntel.dll : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: 'ifort.exe' : return code '0x460'
Stop.

C:\Users\Oeffner\GminAtHome\F77\GminNew>

thanks

Rob



Relevant Pages

  • Re: IVF vs CVF
    ... I would paraphrase part of it as: Microsoft didn't accept ... > Fortran for a lower price than CVF. ... > necessity for a commercial compiler. ... High quality compiler, good support, free email support within ...
    (comp.lang.fortran)
  • Re: who can help me? about OpenMP
    ... I know nothing about how Intel has implemented their compiler on ... Your best source of info on that is the Intel Fortran ... Fortran Compiler for Windows & Visual Fortran ...
    (comp.parallel)
  • Re: Intel Fortran Compiler 11.0 Now Available
    ... compiler knowing from the start what the language requires. ... Developer Products Division ... User communities for Intel Software Development Products ... Intel Fortran Support ...
    (comp.lang.fortran)
  • Re: Using IMSL libraries with Lahey/Intel fortran compilers
    ... > trying to compile a program that use them with the Lahey and Intel ... > fortran compilers. ... You need to get IMSL libraries that are built for the ... compiler you are using. ...
    (comp.lang.fortran)
  • Re: [SLE] Portland Group Fortran Linux compiler
    ... >> You may consider to download and install the free unsupported version of Intel ... >> I'm currently using the intel fortran compiler for all my fortran program and ... > using the GNU compiler. ...
    (SuSE)