Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Compiling an OTL file

Re: Compiling an OTL file

From: Marc Spitzer <marc_at_oscar.eng.cv.net>
Date: Sat, 24 Nov 2001 09:52:59 GMT
Message-Id: <slrn9vurd3.16si.marc@oscar.eng.cv.net>


In article <3BFF123C.FC28B8BC_at_indra.com>, Ron Reidy wrote:

> "Alfredo C." wrote:

>>
>> Hi,
>>
>> I am trying to compile an OTL file under UNIX Solaris, but
>> the compiler sends this outut:
>>
>> Undefined first referenced
>> symbol in file
>> OCIDescriptorAlloc sampleOtl.o
>> OCIErrorGet sampleOtl.o
>> OCITransCommit sampleOtl.o
>> OCIAttrSet sampleOtl.o
>> OCIStmtPrepare sampleOtl.o
>> OCIHandleAlloc sampleOtl.o
>> OCIBindByName sampleOtl.o
>> OCIAttrGet sampleOtl.o
>> OCIInitialize sampleOtl.o
>> OCISessionBegin sampleOtl.o
>> OCIEnvInit sampleOtl.o
>> OCILobWrite sampleOtl.o
>> OCIParamGet sampleOtl.o
>> OCIStmtExecute sampleOtl.o
>> OCIServerDetach sampleOtl.o
>> OCIStmtFetch sampleOtl.o
>> OCIDescriptorFree sampleOtl.o
>> OCIServerAttach sampleOtl.o
>> OCIHandleFree sampleOtl.o
>> OCISessionEnd sampleOtl.o
>> OCIDefineByPos sampleOtl.o
>> ld: fatal: Symbol referencing errors. No output written to sampleOtl
>> *** Error code 1
>>
>> In the Makefile are included the next lines:
>>
>> ### Directory locations
>> LIBPATH = -L$(ORACLE_HOME)/lib \
>> -L$(ORACLE_HOME)/rdbms/lib
>>
>> INCLUDE = -I$(ORACLE_HOME)/rdbms/demo \
>> -I$(ORACLE_HOME)/rdbms/public \
>> -I$(ORACLE_HOME)/plsql/public \
>> -I$(ORACLE_HOME)/network/public
>>
>> Does anyone know what is wrong or what is missing?
>>
>> Any help will be highly appreciated.
> You don't have the correct .h files included in your file samplOtl.pc.
> -- 
> Ron Reidy
> Oracle DBA
> Reidy Consulting, L.L.C.

I think he has problems with librarys not header files, in the case posted. All header file issues will show up befor ld is called. ld is telling you here "I can not find this symbol in any library I can find to link against". You can use commands like 'nm' to dump the symbols in the library files you are not using, in the oracle dir's to find out which ones you need to add. Aslo remember that you need to add the libraries that you need to link in with the -l flag, my C is a pretty rusty but here is a striped down version, iff I remember correctly:

gcc -o fred fred.c -lm

notice how the -l is the last thing on the line, the -lm means link in libm.a to this application. All libraries are prefixed with lib so do not forget to only add from char 4 to the dot on the command line and ld will take care of the rest.

good luck

marc Received on Sat Nov 24 2001 - 03:52:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US