libc.lib error when linking test examples

Ben Tay zonexo at gmail.com
Fri Jun 1 07:13:56 CDT 2007


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20070601/3c88395e/attachment.htm>


More information about the petsc-users mailing list