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