You need to link to all of the libraries. At the petsc top directory issue:
make PETSC_DIR=$PWD PETSC_ARCH=arch-linux2-c-debug getlinklibs That'll give you all the libraries that need to be linked to the executable On Thu, Sep 6, 2012 at 12:23 AM, <0sabio00 at gmail.com> wrote: > I think i'm having a trouble linking to the petsc library. > > gcc main.cpp -I /path to /petsc-3.3-p3/include -I /path > to/petsc-3.3-p3/arch-linux2-c-debug/include > -L/path to /petsc-3.3-p3/arch-linux2-c-debug/lib/ -lpetsc-o test > > I get an error => DMGetMatrix not declared in this scope. > > and I realized that I can't find libpetsc.a or libpetsc.so anywhere. > Where is the petsc library exactly? if I find the location of the petsc > library and link it would it fix the problem? > > Thanks > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120906/227f66b5/attachment.html>