cancel
Showing results for 
Search instead for 
Did you mean: 

Pro*C Error

SOLVED
Go to solution
NDhivya
Advisor

Pro*C Error

Hi,

When we try to compile and link a pro*c file we get the below error. Can any one highlight what might be causing the error ?

Operating System: HP-UX Itanium 11.31
Database: 10.2.0.4
Pro*C compiler version: pro*C/C++: Release 10.2.0.4.0
C/C++ Version: HP C/aC++ for Integrity Servers B3910B A.06.17 [Mar 4 2008]

/home/builddir $ make build_plc_barts
/opt/ansic/bin/cc -o plc_barts assign_plc_chan.o init_plc_devices.o plc_barts.o queue_plc4
ld: Mismatched ABI (not an ELF file) for -lclntsh, found /lib/hpux64/libclntsh.so
Fatal error.
*** Error exit code 1


/home/builddir $ make build_get_plc_data
Making Object files for get_plc_data.c
/opt/ansic/bin/cc -c +DD64 -I. -I../lib -I/u01/dba/oracle/product/10.2.0/precomp/public c
/opt/ansic/bin/cc -o get_plc_data get_plc_data.o -L/lib/hpux64 -L/u01/dba/oracle/product/14
ld: Unsatisfied symbol "sqlcx2t" in file get_plc_data.o
ld: Unsatisfied symbol "main" in file
2 errors.
*** Error exit code 1 (ignored)
/bin/rm -f get_plc_data.o

The make file has the following

# C compiler flags
CFLAGS= +DD64

LFLAGS= -L/lib/hpux64 -L/u01/dba/oracle/product/10.2.0/lib -lclntsh +DD64

# C compiler include directories
IFLAGS= -I. -I../lib $(PRECOMPPUBLIC) -I/u01/dba/oracle/product/10.2.0/precomp/public

build_get_plc_data: get_plc_data.o
-$(CC) -o get_plc_data get_plc_data.o $(LFLAGS)
$(RM) get_plc_data.o


If required we can upload the complete make file.

Thanks,
Dhivya
29 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

ld: Mismatched ABI (not an ELF file) for -lclntsh, found /lib/hpux64/libclntsh.so

What does "file /lib/hpux64/libclntsh.so" show?

cc -o get_plc_data get_plc_data.o -L/lib/hpux64 -L/u01/dba/oracle/product/14

>-L/lib/hpux64

This path is incorrect, remove it since it is the default. You also are missing +DD64.

I don't see any -l options to specify the shlibs?

LFLAGS= -L/lib/hpux64 ...

Remove this -L.
NDhivya
Advisor

Re: Pro*C Error

Thanks for your response Dennis.

file /lib/hpux64/libclntsh.so shows
ELF-64 shared object file - IA64

We get the below after removing /lib/hpux64 and removing -L from the LFLAGS

/opt/ansic/bin/cc -c +DD64 -I. -I../lib -I/u01/dba/oracle/product/1012ias/precomp/public plc_barts.c
/opt/ansic/bin/cc -o plc_barts assign_plc_chan.o init_plc_devices.o plc_barts.o queue_plc_read.o read_plc_ast.o translate4

ld: Mismatched ABI for -lclntsh, found /usr/lib/hpux64/libclntsh.so
Fatal error.
*** Error exit code 1

Thanks,
Dhivya
Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>file /lib/hpux64/libclntsh.so shows: ELF-64 shared object file - IA64

So you need a 64 bit application.

>cc -c +DD64 plc_barts.c
>cc -o plc_barts assign_plc_chan.o init_plc_devices.o plc_barts.o queue_plc_read.o read_plc_ast.o translate4
ld: Mismatched ABI for -lclntsh

What does file(1) show for each object file:
assign_plc_chan.o init_plc_devices.o plc_barts.o queue_plc_read.o read_plc_ast.o

To get a list of each linker input you can use "-Wl,-t".
NDhivya
Advisor

Re: Pro*C Error

assign_plc_chan.o: ELF-32 relocatable object file - IA64
init_plc_devices.o: ELF-32 relocatable object file - IA64
plc_barts.o: ELF-64 relocatable object file - IA64
queue_plc_read.o: ELF-32 relocatable object file - IA64
read_plc_ast.o: ELF-32 relocatable object file - IA64

It seems that C files uses 32 bit compiler.
All the files refers to /lib.

Please let us know what can be done.

Thanks,
Dhivya
Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>It seems that C files uses 32 bit compiler. Please let us know what can be done.

You need to find their makefiles and make sure CFLAGS has +DD64.
NDhivya
Advisor

Re: Pro*C Error

Hi Dennis,

Appreciate your immediate response.
We are very new to Pro*C and your suggestions are really useful for us.

We have deleted all the object files and created again with +DD64 in the make files.
Now we get C specific errors.

We have a lot of programs. Few programs throw errors and few throuws warnings.
For instance, We get an error saying "Argument was incompatible with formal parameter".

Also we got an error "Cannot load upload_trim_program.o" . We gave 777 permissions to the file and tried compiling it again. It threw an error saying "Execute Permission denied".

Please help.

Thanks,
Dhivya



Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>We are very new to Pro*C and your suggestions are really useful for us.

(I know very little about Pro*c.)

>Now we get C specific errors.

Then you need to stop and use the 32 bit version of libclntsh. Going to 64 bit requires porting work.

>We get an error saying "Argument was incompatible with formal parameter".

This is likely an error you would have to fix if you had to port.

>we got an error "Cannot load upload_trim_program.o". We gave 777 permissions to the file and tried compiling it again. It threw an error saying "Execute Permission denied".

Who is giving the error? Where are your error logs?
NDhivya
Advisor

Re: Pro*C Error

Hi Dennis,

I modified the CFLAGS and LFLAGS to +DD32 and tried compiling.

Now i get an error saying ". Stop.nnot read or get /u01/dba/oracle/product/10.2.0/precomp/lib/env_precomp.mk"

Please suggest.

Thanks,
Dhivya

Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>Now I get an error saying "Stop. cannot read or get /u01/dba/oracle/product/10.2.0/precomp/lib/env_precomp.mk"

Is this before or after the previous errors?
Any other errors in your make output?

Does this env_precomp.mk file exist?
NDhivya
Advisor

Re: Pro*C Error

>Is this before or after the previous errors?

This error is occuring only after i modified the CFLAGS AND LFLAGS to +DD32 in the makefile.
I also tried changing it back to +DD64.
Still getting same error.

>Any other errors in your make output?

No i get only this error

>Does this env_precomp.mk file exist?
Yes, it exists.

Thanks,
Dhivya
Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>I also tried changing it back to +DD64. Still getting same error.
>>Does this env_precomp.mk file exist?
>Yes, it exists.

Is it accessible by the user and the contents not changed?
NDhivya
Advisor

Re: Pro*C Error

Yes, it is accessible by the user and the contents are not changed.

Thanks,
Dhivya
Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>it is accessible by the user and the contents are not changed.

Then you are going to have to go looking for zebras. :-)
We need to find out why make can't find that file by using tusc:
tusc -fp -o tusc.out your-make-command
NDhivya
Advisor

Re: Pro*C Error

Thank you Dennis.

Actually while modifying the make file i FTPd it to local machine and opened using notepad and moved it back to the server. Notepad has inserted some junk characters and that was causing the issue.

Now, we get few warning when we try compiling the programs. And the program gets compiled when we use +D on CFLAG. We want to fix the program rather than supressing the error.

We get the follwing error when we tried compiling a program.

ld: Unsatisfied symbol "sqlcx2t" in file get_plc_data.o
ld: Unsatisfied symbol "main" in file
2 errors.
*** Error exit code 1 (ignored)
/bin/rm -f get_plc_data.o

We guess that the fix may be as simple as adding a header file. But we donot knwo what that header file is.

Also, we get the following,

/home/builddir $ make build_sy_ocstobarts
Making Object files for sy_ocstobarts.c
/usr/ccs/bin/cc -c +DD64 +W2225,2009,2001,2174,2177,2117,2181,2180,4212,2549,2167,2169 -I. -I../lib -I/u01/dba/oracle/prodc
/usr/ccs/bin/cc -o sy_ocstobarts sy_ocstobarts.o -L/u01/dba/oracle/product/1012ias/lib -lclntsh +DD64
ld: Unsatisfied symbol "piut_setservernode" in file sy_ocstobarts.o
ld: Unsatisfied symbol "pipt_findpoint" in file sy_ocstobarts.o
ld: Unsatisfied symbol "piut_connect" in file sy_ocstobarts.o
ld: Unsatisfied symbol "pitm_systime" in file sy_ocstobarts.o
ld: Unsatisfied symbol "pitm_formtime" in file sy_ocstobarts.o
ld: Unsatisfied symbol "piut_netserverinfo" in file sy_ocstobarts.o
ld: Unsatisfied symbol "piar_compvalues" in file sy_ocstobarts.o
7 errors.
*** Error exit code 1

Gess they are refering to missing PI interface components.

Can you please help us out in this issue?

Thanks,
Dhivya
Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>when we use +D on CFLAG.

You mean +W?

ld: Unsatisfied symbol "sqlcx2t"
ld: Unsatisfied symbol "main"

Is the first in some Oracle shlib?
Where is your main?

>Guess they are referring to missing PI interface components.

Did you forget to add a -l library?
NDhivya
Advisor

Re: Pro*C Error

Oh..yes..i meant +W.

>Is the first in some Oracle shlib?
Am not sure of that.

>Did you forget to add a -l library?

Actually, we have been using these files in 64 bit so far in HP_UX PA-RISC 11i and when moved to HP_UX Itanium 11.31 these programs are throwing this error.
So we are not sure what libraries to include.
Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>Am not sure of that.

Are you still linking with -lclntsh?

>So we are not sure what libraries to include.

Start with the same -l but you'll need to change any -L.
NDhivya
Advisor

Re: Pro*C Error

We have modified the LFLAGS as you suggested.

# C compiler flags
CFLAGS= +DD64

LFLAGS= -L$(ORACLE_HOME)/lib -lclntsh +DD64

# C compiler include directories
IFLAGS= -I. -I../lib $(PRECOMPPUBLIC) -I$(ORACLE_HOME)/precomp/public

# Target definitions
build_get_plc_data: get_plc_data.o
-$(CC) -o get_plc_data get_plc_data.o $(LFLAGS)
$(RM) get_plc_data.o

Thanks,
Dhivya
NDhivya
Advisor

Re: Pro*C Error

Hi Dennis,

We get few warnings while compiling the files.

"core_cards2.c", line 355: warning #2181-D: argument is incompatible with
corresponding format string conversion
fscanf(infile, "%s", &uidx);
^

"core_cards2.c", line 853: warning #2174-D: expression has no effect
exit;
^

Please help.

Thanks,
Dhivya
Dennis Handly
Acclaimed Contributor
Solution

Re: Pro*C Error

>fscanf(infile, "%s", &uidx);

What is the type of uidx? A %s should match a char* or a char array.

>exit;

If you want to exit, you need: exit(0);
NDhivya
Advisor

Re: Pro*C Error

udix is a char array.

Dennis Handly
Acclaimed Contributor

Re: Pro*C Error

>udix is a char array.

That isn't valid. Using &udix is a char**. This doesn't match %s. So remove the &.
NDhivya
Advisor

Re: Pro*C Error

It worked :D
But i dont understand why & should be removed.
Can you please explain?
NDhivya
Advisor

Re: Pro*C Error

Dennis,

I get an error,

"sc_upload_loads2.c", line 381: warning #2181-D: argument is incompatible with
corresponding format string conversion
roll_size, prod_order_tons);
^

in a statement " printf ("%6d %2d %6.2f %4.2f\n", weyer_order_no, count_knives,
roll_size, prod_order_tons);"


prod_order_tons is of type int.

I get another error,

"sc_upload_loads2.c", line 1301: warning #2181-D: argument is incompatible
with corresponding format string conversion
scanf ("%f", price);
^
here price is of type float.

Please suggest.

Thanks,
Dhivya