libc.lib error when linking test examples
Satish Balay
balay at mcs.anl.gov
Fri Jun 1 08:57:54 CDT 2007
Is this compaq visual fortran?
You'll have to use FLINKER for c examples as well. [because of fortran
blas - and only compaq f90 know how to do the linking correctly - when
fortran objects are involved]. Configure can't handle this case
automatically.
One way to do this is to manualy edit bmake/$PETSC_ARCH/petscconf and
change PCC_LINKER to use 'win32fe f90'
Satish
On Fri, 1 Jun 2007, Ben Tay wrote:
> Hi,
>
> I'm using ms vc++ and vf in windows xp. I tried to compile PETSc 2.3.3p0.
> Running configure has no problem. Compiling seems ok but in the last part
> when it tried to test examples, the error is
>
> --------------Error detected during compile or link!-----------------------
> See http://www.mcs.anl.gov/petsc/petsc-2/documentation/troubleshooting.html
> /codes/petsc-2.3.3-p0/bin/win32fe/win32fe cl -o ex19.o -c -MT -Z7
> -I/codes/petsc-2.3.3-p0 -I/codes/petsc-2.3.3-p0/bmake/
> win32_mpi -I/codes/petsc-2.3.3-p0/include
> -I/cygdrive/d/cygwin/codes/MPICH/SDK/include
> -D__SDIR__="src/snes/examples/tut
> orials/" ex19.c
> ex19.c
> /codes/petsc-2.3.3-p0/bin/win32fe/win32fe cl -MT -Z7 -o ex19
> ex19.o-L/codes/petsc-
> 2.3.3-p0/lib/win32_mpi -L/codes/pet
> sc-2.3.3-p0/lib/win32_mpi -lpetscsnes -lpetscksp -lpetscdm -lpetscmat
> -lpetscvec -lpetsc /cygdrive/d/cygwin/codes/MPIC
> H/SDK/lib/mpich.lib
> -L/codes/petsc-2.3.3-p0/externalpackages/fblaslapack/win32_mpi
> -L/codes/petsc-2.3.3-p0/externalpacka
> ges/fblaslapack/win32_mpi -lflapack
> -L/codes/petsc-2.3.3-p0/externalpackages/fblaslapack/win32_mpi
> -L/codes/petsc-2.3.3-
> p0/externalpackages/fblaslapack/win32_mpi -lfblas Gdi32.lib User32.lib
> Advapi32.lib Kernel32.lib Ws2_32.lib -L'/cygdriv
> e/c/Program Files/Microsoft Visual Studio/DF98/LIB'
> dformt.lib(matherr.obj) : error LNK2005: __matherr already defined in
> LIBCMT.lib(matherr.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __cinit already defined in LIBCMT.lib
> (crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: _exit already defined in LIBCMT.lib(
> crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __exit already defined in LIBCMT.lib(
> crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __cexit already defined in LIBCMT.lib
> (crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __C_Exit_Done already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __C_Termination_Done already defined
> in LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __exitflag already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __wpgmptr already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __pgmptr already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: ___winitenv already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __wenviron already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: ___initenv already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __environ already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: ___wargv already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: ___argv already defined in LIBCMT.lib
> (crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: ___argc already defined in LIBCMT.lib
> (crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __winminor already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __winmajor already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __winver already defined in
> LIBCMT.lib(crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __osver already defined in LIBCMT.lib
> (crt0dat.obj)
> libc.lib(crt0dat.obj) : error LNK2005: __umaskval already defined in
> LIBCMT.lib(crt0dat.obj)
> LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other
> libs; use /NODEFAULTLIB:library
> d:\cygwin\codes\PETSC-~1.3-P\src\snes\examples\TUTORI~1\ex19.exe : fatal
> error LNK1169: one or more multiply defined sym
> bols found
> make[3]: [ex19] Error 2 (ignored)
> /usr/bin/rm -f ex19.o
>
> My configure command is :
>
> ./config/configure.py --with-cc='win32fe cl' --with-fc='win32fe f90'
> --download-f-blas-lapack=1 LIBS="-L'/cygdrive/c/Program Files/Microsoft
> Visual Studio/DF98/LIB'" --with-x=0
> --with-mpi-dir=/cygdrive/d/cygwin/codes/MPICH/SDK
>
> Hope someone can help.
>
> Thank you.
>
More information about the petsc-users
mailing list