Operating System - HP-UX
1819814 Members
2724 Online
109607 Solutions
New Discussion

Compile Proc*C with debug option

 
SOLVED
Go to solution
Duda_1
Frequent Advisor

Compile Proc*C with debug option

I have a big trouble, I can´t compile a program with debug option. I don't know if I'm making a mistake.

If a Compile on this way, results OK! and I can generate my .exe:

make -f $ORACLE_HOME/precomp/demo/proc/demo_proc.mk build EXE=pruebita.exe OBJS=pruebita.o

But if I compile like this:

make -g $ORACLE_HOME/precomp/demo/proc/demo_proc.mk build EXE=pruebita.exe OBJS=pruebita.o

result: `/oracle/product/9.2.0/precomp/demo/proc/demo_proc.mk' is up to date.
Make: Don't know how to make build. Stop.

Maybe I'm missing something... somebody could help me please!!
7 REPLIES 7
Duda_1
Frequent Advisor

Re: Compile Proc*C with debug option

I forgot to say:
My operating system is HPUX 11.23 (ITANIUM)

Thanks a lot for any response.

A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Compile Proc*C with debug option

Make doesn't have a clue what "-g" means. You need to modify the makefile itself where the suffixes and rules are to add the -g flag to the options supplied to the C/C++ compiler. These are generally found in the include files listed in the actual makefile.
If it ain't broke, I can fix that.
Duda_1
Frequent Advisor

Re: Compile Proc*C with debug option

Please, could yo tell me where to add the -g
I did a review of my demo_prok.mk but I didn't figure out where to put it.
A. Clay Stephenson
Acclaimed Contributor

Re: Compile Proc*C with debug option

I don't have an Itanium box handy but the solution should be very similar.

In demo_proc.mk there is a line similar to this:
include $(ORACLE_HOME)/precomp/lib/env_precomp.mk

It is this file that needs to me modified.

There should be a definition for CCFLAGS; modify it and add "-" to it.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Compile Proc*C with debug option

Ooops,

That should be:

There should be a definition for CCFLAGS; modify it and add "-g" to it.

You make also see some use of $(GFLAG) but without a definition for it. Instead of modifying CCFLAGS, you could add a definition
GFLAG=-g
near the top of the include file.

You really need to understand make before tackling ProC or you are going to be faced with many obscure problems. It's probably easier to get started with make compiling plain C programs before adding ProC to the mix.


If it ain't broke, I can fix that.
Duda_1
Frequent Advisor

Re: Compile Proc*C with debug option

thanks, it works!!!

Now I can compile with debug option but I can't finish the complete process because I'm getting the following error

ld: Can't find library or mismatched ABI for -lclntsh
Fatal error.
*** Error exit code 1

Any ideas?
A. Clay Stephenson
Acclaimed Contributor

Re: Compile Proc*C with debug option

The linker is telling you that you haven't told it where to look for libraries. You probably need to define something like PRODLIBHOME in that same make include file.

You really, really need to first learn make or you are simply going to get more of these types of problems. Make is a very good tool and its purpose in life is to look at suffixes (e.g. .c, .pc, .s, .o) and timestamps and decide what operations need to be done to build a target file (an executable, library, etc.). Until you bother to study make, you are wasting time.
If it ain't broke, I can fix that.