<div dir="ltr">Hi Satish,<div><br></div><div>It worked with the mentioned libraries. Thank you very much.</div><div><br></div><div>Regards,</div><div><br></div><div>Bruno Fernandes</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 29, 2015 at 12:21 PM, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you compile an example using a makefile - you should see something like:<br>
<br>
>>>>>>>><br>
sbalay@ps3 ~/petsc.clone/src/ksp/ksp/examples/tutorials<br>
$ make ex2<br>
/home/sbalay/petsc.clone/bin/win32fe/win32fe cl -o ex2.o -c -MT -Z7 -I/home/sbalay/petsc.clone/include -I/home/sbalay/petsc.clone/arch-mswin/include -I/cygdrive/c/Program\ Files/MPICH2/include `pwd`/ex2.c<br>
ex2.c<br>
/home/sbalay/petsc.clone/bin/win32fe/win32fe cl -MT -Z7 -o ex2 ex2.o -L/home/sbalay/petsc.clone/arch-mswin/lib -lpetsc /cygdrive/c/Program\ Files/Intel/MKL/ia32/lib/mkl_c_dll.lib /cygdrive/c/Program\ Files/MPICH2/lib/fmpich2.lib /cygdrive/c/Program\ Files/MPICH2/lib/fmpich2g.lib /cygdrive/c/Program\ Files/MPICH2/lib/fmpich2s.lib /cygdrive/c/Program\ Files/MPICH2/lib/mpi.lib Gdi32.lib User32.lib Advapi32.lib Kernel32.lib Ws2_32.lib<br>
/usr/bin/rm -f ex2.o<br>
<br>
<<<<<<<<<br>
<br>
>From this list - there are some comiler libraries 'Gdi32.lib User32.lib Advapi32.lib Kernel32.lib Ws2_32.lib' listed<br>
in the link linke.<br>
<br>
One of them should provide __imp_GetUserNameA. [Perhaps you need to add them all to the link linke]<br>
<span class="HOEnZb"><font color="#888888"><br>
Satish<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, 29 Sep 2015, Bruno Ramon Batista Fernande wrote:<br>
<br>
> Dear petsc users,<br>
><br>
> I have been trying to use use PETSC on my project on windows. I have<br>
> followed all steps and compiled petsc on windows using cygwin and cmake.<br>
> Then I included it on my visual studio project with all other dependencies.<br>
> After fixing several errors I got stuck with this one:<br>
><br>
> Error 1 error LNK2019: unresolved external symbol __imp_GetUserNameA<br>
> referenced in function PetscGetUserName libpetsc.lib(fuser.o)<br>
><br>
> Anyone has any Idea of which library I should include to solve such<br>
> problem?<br>
><br>
> I am using windows 8 machine with visual studio 2013 and Intel fortran<br>
> 2013, MS MPI, metis, parmetis, and mkl. All libraries are compiled to x64<br>
> and the platform on the VS project was set to x64. I have also activated<br>
> the use of common windows libraries on the VS project to solve other<br>
> problems. This is the configure I used:<br>
><br>
> ./configure --with-cc='win32fe cl' --with-fc='win32fe ifort'<br>
> --prefix=/cygdrive/c/Installed/petsc-opt/ --PETSC_ARCH=windows-intel-opt<br>
> --with-parmetis=1<br>
> --with-parmetis-include=/cygdrive/c/Installed/Parmetis/include_all/<br>
> --with-parmetis-lib=\[/cygdrive/c/Installed/Parmetis/lib/parmetis.lib\]<br>
> --with-metis=1<br>
> --with-metis-include=/cygdrive/c/Installed/Parmetis/include_all/<br>
> --with-metis-lib=\[/cygdrive/c/Installed/Parmetis/lib/metis.lib\]<br>
> --with-mpi-include=[/cygdrive/c/Installed/MPI/Include/,/cygdrive/c/Installed/MPI/Include/x64/]<br>
> --with-mpi-lib=[/cygdrive/c/Installed/MPI/Lib/x64/msmpi.lib,/cygdrive/c/Installed/MPI/Lib/x64/msmpifec.lib]<br>
> --with-blas-lapack-lib=[/cygdrive/c/Installed/mkl/lib/intel64/mkl_intel_lp64.lib,/cygdrive/c/Installed/mkl/lib/intel64/mkl_core.lib,/cygdrive/c/Installed/mkl/lib/intel64/mkl_sequential.lib]<br>
> --with-scalapack-include=/cygdrive/c/Installed/mkl/include<br>
> --with-scalapack-lib=[/cygdrive/c/Installed/mkl/lib/intel64/mkl_scalapack_lp64.lib,/cygdrive/c/Installed/mkl/lib/intel64/mkl_blacs_msmpi_lp64.lib]<br>
> --with-fortran-interfaces=1 --with-debugging=0<br>
><br>
> regards,<br>
><br>
<br>
</div></div></blockquote></div><br></div>