Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003
    Posts
    1

    Question Unanswered: Oracle OCCI makefile example

    Hi all, does anyone know how to build a sample makefile for an OCCI application? Let's say that the files are test.cpp and test.h, how would you write a makefile to compile these files and link any necessary OCCI libraries to it.

    I looked at the demo examples that came with Oracle but couldn't really figure out their makefile.

    Thanks
    Ahmed

  2. #2
    Join Date
    Apr 2012
    Posts
    1

    Makefile for OCCI

    suppose the files are A.cpp, B.cpp,C.cpp
    the the content of makefile is as:
    ################################################## ############
    all: label1 label2
    label1:
    g++ -c -I /home/kalpurush/instantclient_10_2/sdk/include A.cpp B.cpp C.cpp -w
    label2:
    g++ /home/kalpurush/instantclient_10_2/libclntsh.so.10.1 /home/kalpurush/instantclient_10_2/libocci.so.10.1 /home/kalpurush/instantclient_10_2/libnnz10.so *.o -o OUTPUT_DEBUG -w
    clean: rm -rf *.o OUTPUT_DEBUG
    ################################################## #########
    This is a simple make file
    1)where label1 and label2 can be any name of your choice
    2)label 1 produces object file A.o, B.o, C.o
    3)label2 links the object file to the library to produce executable
    4)option -I in label1 specifies occi the headers to include. In my case the path to include directory was /home/kalpurush/instantclient_10_2/sdk/include, which may differ in your case
    5)in label2, full path to occi library is specified
    6) *.o parameter in label2 specifies the object to link
    7)OUTPUT_DEBUG specifies the name of executable which can be any name of your choice


    regards,
    Kalpurush
    Give your hand to server and heart to love

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •