Thursday, March 24, 2005

PROC this time

I started to do a Pro C today. Got a example file, sample.pc.
Now need to do:
proc INAME=sample.pc
This will generate a sample.c file.
Now I do:
gcc -I someinclude -L somelib te.c
I got this error:

Undefined first referenced
symbol in file
sqlcex sample1.o
sqlglm sample1.o

From http://krypton.stern.nyu.edu:7700/oradocs/solaris.815/a67456/ch4.htm, I got:

This error occurs when the linker cannot find a definition for a referenced symbol. Generally, the remedy for this type of problem is to ensure that the library or object file containing the definition exists on the link line and that the linker is searching the correct directories for the file.

Oracle provides a utility called symfind to assist in locating a library or object file where a symbol is defined. Here is example output of symfind locating the symbol sqlcex:

$ symfind sqlcex

SymFind - Find Symbol in <**>.a, .o, .so
------------------------------------------------------
Command: /u01/app/oracle/product/8.1.5/bin/symfind sqlcex
Local Directory: /u01/app/oracle/product/8.1.5
Output File: (none)
Note: I do not traverse symbolic links
Use '-v' option to show any symbolic links

Locating Archive and Object files ...
[11645] | 467572| 44|FUNC |GLOB |0 |8 |sqlcex
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ./lib/libclntsh.so
[35] | 0| 44|FUNC |GLOB |0 |5 |sqlcex
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ./lib/libsql.a

Now I issue:
gcc -I someinclude -L somelib -lclntsh te.c

It then works
Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?