- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If Ifort links( using"-Qlocation,link,"C:\\Program Files\\Microsoft Visual Studio 8\\VC")FORTRAN codewith a static librarylibHYPRE.agenerated by gccfrom C code under cygwin,then the link can not find main functionof my application FUNCTION code, but use one of main function in libcygwin.a to result in a link error as follows.
Any suggestion? thanks in advance.
David.
=======================================
ifort main.f -c main.obj
Intel Visual Fortran Compiler Professional for applications running on IA-32, Version 11.1 Build 20090624 Package ID: w_cprof_p_11.1.038
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
ifort: warning #10146: no action performed for specified object file(s)
ifort module11.obj module12.obj module1.obj ads0.obj gmsini.obj vis0.obj rperm0.obj outdt3.obj alloc1.obj alloc2.obj alloc3.obj flux.obj mayer.obj hystmw.obj hyswwg.obj hyswws.obj resread.obj welread.obj cubic2.obj dpread.obj adoil.obj init.obj phabio.obj thirdd.obj main.obj densty.obj inst.obj odistm1.obj rstart.obj trapno.obj abnc.obj eacnms.obj ioncng.obj odiswo.obj single.obj try.obj adsorb.obj engbal.obj isamax.obj omofr.obj slv2eq.obj twoalc.obj alcptn.obj f.obj isrcheq.obj outdt1.obj solb.obj utfoam.obj asign1.obj file1.obj isrcheqi.obj outdt2.obj solmat.obj vgamma.obj asign2.obj file2.obj isrchfge.obj phasc.obj solve.obj viscos.obj bioread.obj file3.obj jacup.obj phcomp.obj sumtab.obj well.obj biosolve.obj g.obj jcg.obj printi.obj tcap.obj wellck.obj bundry.obj gauss.obj lauwer.obj printo.obj tdiffu.obj wellix.obj capnum.obj gel.obj manipl.obj prints.obj tielin.obj wheneq.obj coneq.obj georead.obj metric.obj qrate.obj time0.obj wmeacn.obj csecal.obj grdfac.obj moppst.obj radius.obj totals.obj cseod.obj noneq.obj reactr.obj tran1.obj matrixconv.obj cubic.obj ilsum.obj noneqk.obj renam1.obj trans.obj cvmgt.obj inname.obj nslug.obj renam2.obj trap.obj ddriv2.obj inout.obj odistm.obj revise.obj trapg.obj utchem_hypre.obj hypresolver.obj libcygwin.a libgpc.a libHYPRE.a -o utchem93
Intel Visual Fortran Compiler Professional for applications running on IA-32, Version 11.1 Build 20090624 Package ID: w_cprof_p_11.1.038
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
-out:utchem93.exe
-subsystem:console
module11.obj
module12.obj
module1.obj
ads0.obj
gmsini.obj
vis0.obj
rperm0.obj
outdt3.obj
alloc1.obj
alloc2.obj
alloc3.obj
flux.obj
mayer.obj
hystmw.obj
hyswwg.obj
hyswws.obj
resread.obj
welread.obj
cubic2.obj
dpread.obj
adoil.obj
init.obj
phabio.obj
thirdd.obj
main.obj
densty.obj
inst.obj
odistm1.obj
rstart.obj
trapno.obj
abnc.obj
eacnms.obj
ioncng.obj
odiswo.obj
single.obj
try.obj
adsorb.obj
engbal.obj
isamax.obj
omofr.obj
slv2eq.obj
twoalc.obj
alcptn.obj
f.obj
isrcheq.obj
outdt1.obj
solb.obj
utfoam.obj
asign1.obj
file1.obj
isrcheqi.obj
outdt2.obj
solmat.obj
vgamma.obj
asign2.obj
file2.obj
isrchfge.obj
phasc.obj
solve.obj
viscos.obj
bioread.obj
file3.obj
jacup.obj
phcomp.obj
sumtab.obj
well.obj
biosolve.obj
g.obj
jcg.obj
printi.obj
tcap.obj
wellck.obj
bundry.obj
gauss.obj
lauwer.obj
printo.obj
tdiffu.obj
wellix.obj
capnum.obj
gel.obj
manipl.obj
prints.obj
tielin.obj
wheneq.obj
coneq.obj
georead.obj
metric.obj
qrate.obj
time0.obj
wmeacn.obj
csecal.obj
grdfac.obj
moppst.obj
radius.obj
totals.obj
cseod.obj
noneq.obj
reactr.obj
tran1.obj
matrixconv.obj
cubic.obj
ilsum.obj
noneqk.obj
renam1.obj
trans.obj
cvmgt.obj
inname.obj
nslug.obj
renam2.obj
trap.obj
ddriv2.obj
inout.obj
odistm.obj
revise.obj
trapg.obj
utchem_hypre.obj
hypresolver.obj
libcygwin.a
libgpc.a
libHYPRE.a
libcygwin.a(libcmain.o) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _main
utchem93.exe : fatal error LNK1120: 1 unresolved externals
make: *** [utchem93] Error 96
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I might suggest adding, at the end of the ifort command that links:
/link /verbose
and look at the output to see what is getting referenced from where. Of course, we don't support use of ifort with Cygwin/gcc... Perhaps others who have experience with Cygwin can help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David
ifort module11.obj module12.obj module1.obj ads0.obj gmsini.obj vis0.obj rperm0.obj outdt3.obj alloc1.obj alloc2.obj alloc3.obj flux.obj mayer.obj hystmw.obj hyswwg.obj hyswws.obj resread.obj welread.obj cubic2.obj dpread.obj adoil.obj init.obj phabio.obj thirdd.obj main.obj densty.obj inst.obj odistm1.obj rstart.obj trapno.obj abnc.obj eacnms.obj ioncng.obj odiswo.obj single.obj try.obj adsorb.obj engbal.obj isamax.obj omofr.obj slv2eq.obj twoalc.obj alcptn.obj f.obj isrcheq.obj outdt1.obj solb.obj utfoam.obj asign1.obj file1.obj isrcheqi.obj outdt2.obj solmat.obj vgamma.obj asign2.obj file2.obj isrchfge.obj phasc.obj solve.obj viscos.obj bioread.obj file3.obj jacup.obj phcomp.obj sumtab.obj well.obj biosolve.obj g.obj jcg.obj printi.obj tcap.obj wellck.obj bundry.obj gauss.obj lauwer.obj printo.obj tdiffu.obj wellix.obj capnum.obj gel.obj manipl.obj prints.obj tielin.obj wheneq.obj coneq.obj georead.obj metric.obj qrate.obj time0.obj wmeacn.obj csecal.obj grdfac.obj moppst.obj radius.obj totals.obj cseod.obj noneq.obj reactr.obj tran1.obj matrixconv.obj cubic.obj ilsum.obj noneqk.obj renam1.obj trans.obj cvmgt.obj inname.obj nslug.obj renam2.obj trap.obj ddriv2.obj inout.obj odistm.obj revise.obj trapg.obj utchem_hypre.obj hypresolver.obj libcygwin.a libgpc.a libHYPRE.a -o utchem93 /link /verbose
Intel Visual Fortran Compiler Professional for applications running on IA-32, Version 11.1 Build 20090624 Package ID: w_cprof_p_11.1.038
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
-out:utchem93.exe
-subsystem:console
/verbose
......
utchem_hypre.obj
hypresolver.obj
libcygwin.a
libgpc.a
libHYPRE.a
Starting pass 1
Processed /DEFAULTLIB:ifconsol
Processed /DEFAULTLIB:libifcoremt
Processed /DEFAULTLIB:libifport
Processed /DEFAULTLIB:libmmt
Processed /DEFAULTLIB:LIBCMT
Processed /DEFAULTLIB:libirc
Processed /DEFAULTLIB:svml_disp
Processed /DEFAULTLIB:OLDNAMES
Searching libraries
Searching libcygwin.a:
Searching libgpc.a:
Searching libHYPRE.a:
Found _HYPRE_IJMATRIXCREATE
Referenced in hypresolver.obj
Loaded libHYPRE.a(F90_HYPRE_IJMatrix.o)
........
Referenced in libirc.lib(tbk_display.obj)
Referenced in libirc.lib(tbk_backtrace.obj)
Loaded LIBCMT.lib(splitpat.obj)
Found __except_handler3
Referenced in libirc.lib(tbk_backtrace.obj)
Loaded LIBCMT.lib(exsup3.obj)
Found __mbsnbcpy_s
Referenced in LIBCMT.lib(splitpat.obj)
Loaded LIBCMT.lib(mbsnbcpy_s.obj)
Found _CallDestructExceptionObject
Referenced in LIBCMT.lib(exsup3.obj)
Loaded LIBCMT.lib(calldtor.obj)
Found __ValidateEH3RN
Referenced in LIBCMT.lib(exsup3.obj)
Loaded LIBCMT.lib(eh3valid.obj)
Found __mbsnbcpy_s_l
Referenced in LIBCMT.lib(mbsnbcpy_s.obj)
Loaded LIBCMT.lib(mbsnbcpy_s_l.obj)
Searching C:\Program Files\Intel\Compiler\11.1\038\Lib\ia32\libirc.lib:
Searching C:\Program Files\Intel\Compiler\11.1\038\Lib\ia32\svml_disp.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB\OLDNAMES.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB\uuid.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB\kernel32.lib:
Searching C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ImageHlp.lib:
Searching libcygwin.a:
Searching libgpc.a:
Searching libHYPRE.a:
Searching C:\Program Files\Intel\Compiler\11.1\038\Lib\ia32\ifconsol.lib:
Searching C:\Program Files\Intel\Compiler\11.1\038\Lib\ia32\libifcoremt.lib:
Searching C:\Program Files\Intel\Compiler\11.1\038\Lib\ia32\libifport.lib:
Searching C:\Program Files\Intel\Compiler\11.1\038\Lib\ia32\libmmt.lib:
Finished searching libraries
Finished pass 1
Generating non-SAFESEH image.
libcygwin.a(libcmain.o) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _main
utchem93.exe : fatal error LNK1120: 1 unresolved externals
make: *** [utchem93] Error 96
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In any event, the issue is that something is referening libcmain.o from the Cygwin library but nothing is providing the _WinMain@16 entry point. I don't know if it would help to add /link /subsystem:console (don't have two /link switches) at the end of the ifort command, but you really need a Cygwin expert here. The issue is not Fortran.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page