Christophe Ortiz <[email protected]> writes:

> Hi all,
>
> Since I would like to use classes, I am moving my C code to C++. I compiled
> PETSc with g++ using the following options for the configure:
>
> --with-mpi=0 --with-fc=ifort --with-cxx=g++ --with-debugging=1
> --with-scalar-type=real --with-precision=double --download-f-blas-lapack
>
> It did not complain, everything went smooth.
>
> Then to compile I use:
>
> diffusion_c: diffusion.o chkopts
>         -${CLINKER} -o diffusion_c diffusion.o ${PETSC_TS_LIB}
>         ${RM} diffusion.o
>
>
> I declared a simple class at the beginning of the file and it complains.
> When I compile I get:
>
> gcc -o diffusion.o -c -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing
> -Wno-unknown-pragmas -g3 -fno-inline -O0
> -I/home/u5751/petsc-3.4.1/include
> -I/home/u5751/petsc-3.4.1/ifort-gpp-nompi-double-blas-debug/include
> -I/home/u5751/petsc-3.4.1/include/mpiuni
>  -D__INSDIR__=src/ts/examples/tutorials/ diffusion.c
>
> diffusion.c:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
> before ‘defect’

Name your source file diffusion.cxx

Attachment: pgpjlI_IYyDVc.pgp
Description: PGP signature

Reply via email to