<font face="courier new,monospace">You have:<div><br></div><div style="margin-left: 40px !important"><em><strong>typedef enum {DIRICHLET, NEUMANN} BCType;</strong></em></div><div><br></div><div>twice in your source: ex29.c</div>
<div><br></div><div>---John</div></font><br><br>On Wed, Jul 27, 2011 at 3:46 PM, Alan Wei &lt;<a href="mailto:zhenglun.wei@gmail.com">zhenglun.wei@gmail.com</a>&gt; wrote:<br>&gt; Dear John,<br>&gt;     Thanks for your quick reply. I think the error message says that the<br>
&gt; BCType has some problem. However, it is originally there and I have not<br>&gt; changed it at all. Is that because I define it in ComputeRHS again and let<br>&gt; ex29.c include ComputeRHS.h so the BCtype is duplicated?<br>
&gt;<br>&gt; thanks,<br>&gt; Alan<br>&gt;<br>&gt; On Wed, Jul 27, 2011 at 2:04 PM, John Chludzinski &lt;<a href="mailto:jchludzinski@gmail.com">jchludzinski@gmail.com</a>&gt;<br>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Without wading through the attached zip file, it looks like you&#39;re missing<br>
&gt;&gt; some typedef&#39;s that come from a missing include file.  ---John<br>&gt;&gt;<br>&gt;&gt; On Wed, Jul 27, 2011 at 2:38 PM, Alan Wei &lt;<a href="mailto:zhenglun.wei@gmail.com">zhenglun.wei@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; Dear Sir/Madam,<br>&gt;&gt;&gt;     I hope you&#39;re having a nice day.<br>&gt;&gt;&gt;     I asked several questions about src/ksp/ksp/example/tutorial/ex29.c<br>&gt;&gt;&gt; before, and learned some beginning staff of PETSc. Right now, I want to<br>
&gt;&gt;&gt; start to use it to my own program. Firstly, I want to isolate the ComputeRHS<br>&gt;&gt;&gt; function in ex29, which means I want to put ComputeRHS to another c program<br>&gt;&gt;&gt; file. I did that; however, some problem pop up when I compile it.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; /home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/bin/mpicc -o<br>&gt;&gt;&gt; ex29.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas<br>&gt;&gt;&gt; -g3 -I/home/zlwei/soft/mercurial/petsc-dev/include<br>
&gt;&gt;&gt; -I/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/include<br>&gt;&gt;&gt; -I/home/zlwei/soft/mercurial/petsc-dev/src/dm/mesh/sieve<br>&gt;&gt;&gt; -D__INSDIR__=src/ksp/ksp/examples/tutorials/ ex29.c<br>
&gt;&gt;&gt; ex29.c: In function ComputeRHS:<br>&gt;&gt;&gt; ex29.c:39: error: storage class specified for parameter BCType<br>&gt;&gt;&gt; ex29.c:44: error: expected specifier-qualifier-list before BCType<br>&gt;&gt;&gt; ex29.c:61: error: expected =, ,, ;, asm or __attribute__ before { token<br>
&gt;&gt;&gt; ex29.c:117: error: expected =, ,, ;, asm or __attribute__ before { token<br>&gt;&gt;&gt; ex29.c:130: error: expected =, ,, ;, asm or __attribute__ before { token<br>&gt;&gt;&gt; ex29.c:197: error: expected =, ,, ;, asm or __attribute__ before { token<br>
&gt;&gt;&gt; ex29.c:220: error: old-style parameter declarations in prototyped<br>&gt;&gt;&gt; function definition<br>&gt;&gt;&gt; ex29.c:220: error: expected { at end of input<br>&gt;&gt;&gt; make: [ex29.o] Error 1 (ignored)<br>
&gt;&gt;&gt; /home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/bin/mpicc -o<br>&gt;&gt;&gt; ComputeRHS.o -c -Wall -Wwrite-strings -Wno-strict-aliasing<br>&gt;&gt;&gt; -Wno-unknown-pragmas -g3 -I/home/zlwei/soft/mercurial/petsc-dev/include<br>
&gt;&gt;&gt; -I/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/include<br>&gt;&gt;&gt; -I/home/zlwei/soft/mercurial/petsc-dev/src/dm/mesh/sieve<br>&gt;&gt;&gt; -D__INSDIR__=src/ksp/ksp/examples/tutorials/ ComputeRHS.c<br>
&gt;&gt;&gt; /home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/bin/mpicc -Wall<br>&gt;&gt;&gt; -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -g3  -o ex29<br>&gt;&gt;&gt; ex29.o ComputeRHS.o<br>&gt;&gt;&gt; -L/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/lib  -lpetsc<br>
&gt;&gt;&gt; -Wl,-rpath,/home/zlwei/soft/mercurial/petsc-dev/arch-linux2-c-debug/lib<br>&gt;&gt;&gt; -lflapack -lfblas -lm -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -ldl -lmpich<br>&gt;&gt;&gt; -lopa -lmpl -lrt -lpthread -lgcc_s -lmpichf90 -lgfortran -lm -lm -ldl<br>
&gt;&gt;&gt; -lmpich -lopa -lmpl -lrt -lpthread -lgcc_s -ldl<br>&gt;&gt;&gt; gcc: ex29.o: No such file or directory<br>&gt;&gt;&gt; make: [ex29] Error 1 (ignored)<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; The program and modified makefile are attached. Could you please take a<br>
&gt;&gt;&gt; look and give me some suggestions.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; best,<br>&gt;&gt;&gt; Alan<br>&gt;&gt;<br>&gt;<br>&gt;<br><br>