I am trying to compile a C++ program on UNIX using CC: Sun C++ 5.11 SunOS_i386
. I created the following Makefile
.
ORACLE_HOME=/app/ora/local/product/11.2.0.3/db_1
CC= CC -m64 -library=iostream
test.cpp : test.pc
$(ORACLE_HOME)/bin/proc test.pc code=CPP sys_include=/usr/include cpp_suffix=cpp
test.o : test.cpp
$(CC) -c test.cpp -DDEBUG -DSOLARIS -I$(ORACLE_HOME)/precomp/public
test.bin: test.o
$(CC) -o test.bin test.o -L$(ORACLE_HOME)/lib -lclntsh -lnsl -lsocket -lgen -ldl
When I executed the Makefile, I am getting the following error...
#include <iostream>
.........1
PCC-S-02015, unable to open include file
Is there anything I am missing? What else I can do?
Assuming that your original source file is a Oracle Pro*C
.pc
file, the error means that Pro*C could not find your include file. If you have no FATAL error below caused by this, the PCC-S-02015 error is in fact a simple warning. The precompiler warns you that it has found an include directive that it could not process, so it leave it untouched in the generated.cpp
file. In that case, it will be correctly processed by the next build step.The problem if often that you use later a symbol defined in one of those include files (mainly a
typedef
or equivalent macro definition of a type) that leads to a fatal compilation error.In that case you have to declare the include folders in the pcscfg.cfg file located at
$ORACLE_HOME/precomp/admin
or include on the command line when invokingproc
.Ref: https://lists.debian.org/debian-user/2001/09/msg00273.html - it is about Debian but describes an equivalent problem.