0

I am using the Pro*C 12.2 precompiler.

I have a .c file which is using free(), but string.h is not included in the .c, .h or .pc files.

The Makefile has SYSHDRS= /usr/include other files, but not string.h.

The executable after compilation is working in an Oracle 11g environment, but not in 12.2.

Note that #include <string.h> is not there in 11g and 12.2, also in the .c file. But it works for Oracle 11g and produces a memory fault for 12.2.

In the Makefile the only difference is the ORACLE_HOME path — in the former it is pointing to 11g and in the latter to 12.2.

Is there any difference between the 11g and 12.2 precompilers related to header files? For both environments string.h is present in /usr/include.

A solution I found was to include string.h in the .pc file. But this is only a temporary solution. Other .pc files are also missing signal.h, and the resulting executable produces a memory fault for 12.2.

Please guide me!

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • If building the executable works, the problem cannot be a missing header file. – Laurenz Albe Jul 03 '19 at 14:48
  • I'm a little lost. You're talk about `free` but then you mention `string.h`. Unless something changed very recently `free` is defined in `stdlib.h`. ??? – Bob Jarvis - Слава Україні Jul 03 '19 at 23:27
  • Thanks for the reply. Let me explain it clearly executable compiled with 12.2 does not work. It throws Memory fault. executable compiled with 11g works with no change in the setup or environment. Only changes is the ORACLE_HOME Path in the Makefile between 11g and 12.2. I agree free() is in stdlib.h but I was getting error in the line no of free() as per gdb back trace. free() was called and defined as below in my code.free_mem(); void free_mem() { free((void *)grp_struct); free((void *)grp_date); } void free_mem(); – Jeya Lakshmi Balu Natarajan Jul 04 '19 at 08:36
  • My Program was having #include already. May be it was missing String.h for some strcpy(). – Jeya Lakshmi Balu Natarajan Jul 04 '19 at 12:34

0 Answers0